PIbd-12 Ulybin A.A. Monorail Lab04 Simple #8

Closed
qkrlnt wants to merge 2 commits from Lab04 into Lab03
3 changed files with 18 additions and 4 deletions
Showing only changes of commit 6e23967d26 - Show all commits

View File

@ -20,7 +20,7 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
private readonly List<T?> _collection;
/// <summary>
/// Максимальо допустимое число объектов в списке
/// Максимально допустимое число объектов в списке
/// </summary>
private int _maxCount;

View File

@ -20,8 +20,23 @@ public class MassiveGenericObjects<T> : ICollectionGenericObjects<T>
public int Count => _collection.Length;
public int SetMaxCount { set { if (value > 0) { _collection = new T?[value]; } } }
public int SetMaxCount
{
set
{
if (value > 0)
{
if (_collection.Length > 0)
{
Array.Resize(ref _collection, value);
}
else
{
_collection = new T?[value];
}
}
}
}
/// <summary>
/// Конструктор
/// </summary>

View File

@ -108,7 +108,6 @@ public class DrawingTrain
/// <returns></returns>
public bool SetPictureSize(int width, int height)
{
//TODO!
if (_drawingMonorailWidth <= width && _drawingMonorailHeight <= height)
{
_pictureWidth = width;