using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AirBomber.DrawningObjects; using AirBomber.MovementStrategy; namespace AirBomber.Generics { internal class BomberGenericStorage { readonly Dictionary> _bomberStorage; /// /// Возвращение списка названий наборов /// public List Keys => _bomberStorage.Keys.ToList(); /// /// Ширина окна отрисовки /// private readonly int _pictureWidth; /// /// Высота окна отрисовки /// private readonly int _pictureHeight; /// /// Конструктор /// /// /// public BomberGenericStorage(int pictureWidth, int pictureHeight) { _bomberStorage = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } public void AddSet(string name) { // TODO Прописать логику для добавления if (!_bomberStorage.ContainsKey(name)) { var bomberCollection = new BomberGenericCollection(_pictureWidth, _pictureHeight); _bomberStorage.Add(name, bomberCollection); } } public void DelSet(string name) { // TODO Прописать логику для удаления if (_bomberStorage.ContainsKey(name)) { _bomberStorage.Remove(name); } } public BomberGenericCollection? this[string ind] { get { // TODO Продумать логику получения набора if (_bomberStorage.ContainsKey(ind)) { return _bomberStorage[ind]; } return null; } } } }