PIbd-14_Calimullin_A.R._Lab06_Simple #7
@ -35,7 +35,7 @@ public abstract class AbstractCompany
|
||||
/// <summary>
|
||||
/// Вычисление максимального количества элементов, который можно разместить в окне
|
||||
/// </summary>
|
||||
private int GetMaxCount => _pictureWidth * _pictureHeight / (_placeSizeWidth * _placeSizeHeight);
|
||||
private int GetMaxCount => (_pictureWidth / _placeSizeWidth) * (_pictureHeight / _placeSizeHeight);
|
||||
|
||||
/// <summary>
|
||||
/// Конструктор
|
||||
@ -113,5 +113,4 @@ public abstract class AbstractCompany
|
||||
/// Расстановка объектов
|
||||
/// </summary>
|
||||
protected abstract void SetObjectsPosition();
|
||||
}
|
||||
|
||||
}
|
@ -44,21 +44,19 @@ public class AirCraftAngar : AbstractCompany
|
||||
/// </summary>
|
||||
protected override void SetObjectsPosition()
|
||||
{
|
||||
int currentIndex = -1;
|
||||
int currentIndex = 0;
|
||||
for (int j = pamat_j; j >= 0; j--)
|
||||
{
|
||||
for (int i = pamat_i; i >= 0; i--)
|
||||
{
|
||||
currentIndex++;
|
||||
if (_collection?.Get(currentIndex) == null) continue;
|
||||
if (_collection?.Get(currentIndex) != null)
|
||||
{
|
||||
_collection.Get(currentIndex)?.SetPictureSize(_pictureWidth, _pictureHeight);
|
||||
_collection.Get(currentIndex)?.SetPosition(i * _placeSizeWidth + 5, j * _placeSizeHeight + 5);
|
||||
|
||||
_collection.Get(currentIndex)?.SetPictureSize(_pictureWidth, _pictureHeight);
|
||||
_collection.Get(currentIndex)?.SetPosition(i * _placeSizeWidth + 5, j * _placeSizeHeight + 5);
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user