PIbd-12 Ulybin A.A. Monorail Lab04 Simple #8
@ -20,7 +20,7 @@ public class ListGenericObjects<T> : ICollectionGenericObjects<T>
|
||||
private readonly List<T?> _collection;
|
||||
|
||||
/// <summary>
|
||||
/// Максимальо допустимое число объектов в списке
|
||||
/// Максимально допустимое число объектов в списке
|
||||
/// </summary>
|
||||
private int _maxCount;
|
||||
|
||||
|
@ -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>
|
||||
|
@ -108,7 +108,6 @@ public class DrawingTrain
|
||||
/// <returns></returns>
|
||||
public bool SetPictureSize(int width, int height)
|
||||
{
|
||||
//TODO!
|
||||
if (_drawingMonorailWidth <= width && _drawingMonorailHeight <= height)
|
||||
{
|
||||
_pictureWidth = width;
|
||||
|
Loading…
Reference in New Issue
Block a user