using ProjectAirFighter.DrawningObjects; using ProjectAirFighter.Generics; using ProjectAirFighter.MovementStrategy; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProjectAirFighter.Generics { internal class AirplanesGenericStorage { readonly Dictionary> _airplaneStorages; public List Keys => _airplaneStorages.Keys.ToList(); private readonly int _pictureWidth; private readonly int _pictureHeight; public AirplanesGenericStorage(int pictureWidth, int pictureHeight) { _airplaneStorages = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } public void AddSet(string name) { _airplaneStorages.Add(name, new AirplaneslGenericCollection(_pictureWidth, _pictureHeight)); } public void DelSet(string name) { if (!_airplaneStorages.ContainsKey(name)) return; _airplaneStorages.Remove(name); } public AirplaneslGenericCollection? this[string ind] { get { if (_airplaneStorages.ContainsKey(ind)) return _airplaneStorages[ind]; return null; } } } }