Правки 4 лаб
This commit is contained in:
parent
bda0646769
commit
270c3d7d4f
@ -29,9 +29,8 @@ namespace Tank.Generics
|
||||
|
||||
public bool Insert(T tank, int position)
|
||||
{
|
||||
if (position < 0 || position >= _maxCount)
|
||||
if (position < 0)
|
||||
return false;
|
||||
|
||||
if (Count >= _maxCount)
|
||||
return false;
|
||||
_places.Insert(0, tank);
|
||||
@ -42,8 +41,6 @@ namespace Tank.Generics
|
||||
{
|
||||
if (position < 0 || position > _maxCount)
|
||||
return false;
|
||||
if (position >= Count)
|
||||
return false;
|
||||
_places.RemoveAt(position);
|
||||
return true;
|
||||
}
|
||||
|
@ -133,7 +133,8 @@ namespace Tank.Generics
|
||||
{
|
||||
if (tank != null)
|
||||
{
|
||||
tank.SetPosition((i % (_pictureWidth / _placeSizeWidth)) * _placeSizeWidth, (i / (_pictureWidth / _placeSizeWidth)) * _placeSizeHeight);
|
||||
tank.SetPosition((i % (_pictureWidth / _placeSizeWidth)) * _placeSizeWidth,
|
||||
i % (_pictureWidth / _placeSizeWidth));
|
||||
|
||||
tank.DrawTransport(g);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user