Compare commits
2 Commits
1d0a18b4b7
...
9cadd9bb31
Author | SHA1 | Date | |
---|---|---|---|
9cadd9bb31 | |||
52950b54cb |
@ -21,11 +21,11 @@ namespace AirBomber
|
||||
/// <summary>
|
||||
/// Размер занимаемого объектом места (ширина)
|
||||
/// </summary>
|
||||
private readonly int _placeSizeWidth = 150;
|
||||
private readonly int _placeSizeWidth = 170;
|
||||
/// <summary>
|
||||
/// Размер занимаемого объектом места (высота)
|
||||
/// </summary>
|
||||
private readonly int _placeSizeHeight = 118;
|
||||
private readonly int _placeSizeHeight = 120;
|
||||
/// <summary>
|
||||
/// Набор объектов
|
||||
/// </summary>
|
||||
@ -118,16 +118,14 @@ namespace AirBomber
|
||||
/// <param name="g"></param>
|
||||
private void DrawObjects(Graphics g)
|
||||
{
|
||||
int heightObjCount = _pictureHeight / _placeSizeHeight;
|
||||
int widthObjCount = _pictureWidth / _placeSizeWidth; // Добавляем вычисление ширины
|
||||
|
||||
int widthObjCount = _pictureWidth / _placeSizeWidth;
|
||||
for (int i = 0; i < _collection.Count; i++)
|
||||
{
|
||||
T? type = _collection.Get(i);
|
||||
if (type != null)
|
||||
{
|
||||
int row = i / widthObjCount; // Ряд - сначала сверху вниз
|
||||
int col = widthObjCount - 1 - (i % widthObjCount); // Столбец - справа налево
|
||||
int row = i / widthObjCount;
|
||||
int col = widthObjCount - 1 - (i % widthObjCount);
|
||||
|
||||
type.SetPosition(col * _placeSizeWidth, row * _placeSizeHeight);
|
||||
type?.DrawPlane(g);
|
||||
|
@ -53,7 +53,7 @@ namespace AirBomber
|
||||
{
|
||||
if (_places[i] != null) NoEmpty++;
|
||||
}
|
||||
if (NoEmpty == Count - position - 1) return -1;
|
||||
if (NoEmpty == Count - position) return -1;
|
||||
|
||||
if (position < Count && position >= 0)
|
||||
{
|
||||
@ -88,7 +88,7 @@ namespace AirBomber
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_places[position] = null;
|
||||
_places[position - 1] = null;
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user