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