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