PIbd-13_Ladyagin_P.D. LabWork06 Simple #8

Closed
F1rsTTeaM wants to merge 8 commits from LabWork06.1 into LabWork05.1
3 changed files with 36 additions and 2 deletions
Showing only changes of commit 75ec5da6bd - Show all commits

View File

@ -47,5 +47,17 @@ namespace ProjectAirplaneWithRadar.CollectionGenericObjects
/// <param name="position">Позиция</param>
/// <returns>Объект</returns>
T? Get(int position);
/// <summary>
/// Получение типа коллекции
/// </summary>
CollectionType GetCollectionType { get; }
/// <summary>
/// Получение объектов коллекции по одному
/// </summary>
/// <returns>Поэлементый вывод элементов коллекции</returns>
IEnumerable<T?> GetItems();
}
}

View File

@ -1,4 +1,5 @@
namespace ProjectAirplaneWithRadar.CollectionGenericObjects

namespace ProjectAirplaneWithRadar.CollectionGenericObjects
{
/// <summary>
/// Параметризованный набор объектов
@ -21,6 +22,8 @@
public int SetMaxCount { set { if (value > 0) { _maxCount = value; } } }
public CollectionType GetCollectionType => CollectionType.List;
/// <summary>
/// Конструктор
/// </summary>
@ -64,5 +67,13 @@
_collection.RemoveAt(position);
return temp;
}
public IEnumerable<T?> GetItems()
{
for (int i = 0; i < _collection.Count; ++i)
{
yield return _collection[i];
}
}
}
}

View File

@ -1,4 +1,5 @@
namespace ProjectAirplaneWithRadar.CollectionGenericObjects

namespace ProjectAirplaneWithRadar.CollectionGenericObjects
{
/// <summary>
/// Параметризованный набор объектов
@ -32,6 +33,8 @@
}
}
public CollectionType GetCollectionType => CollectionType.Massive;
/// <summary>
/// Конструктор
/// </summary>
@ -110,5 +113,13 @@
_collection[position] = null;
return temp;
}
public IEnumerable<T?> GetItems()
{
for (int i = 0; i < _collection.Length; ++i)
{
yield return _collection[i];
}
}
}
}