using ProjectLainer.DrawningObjects; using ProjectLainer.MovementStrategy; namespace ProjectLainer.Generics { /// /// Класс для хранения коллекции /// internal class LainersGenericStorage { readonly Dictionary> _lainerStorages; public List Keys => _lainerStorages.Keys.ToList(); private readonly int _pictureWidth; private readonly int _pictureHeight; public LainersGenericStorage(int pictureWidth, int pictureHeight) { _lainerStorages = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } public void AddSet(string name) { if (!_lainerStorages.ContainsKey(name)) { _lainerStorages.Add(name, new LainersGenericCollection(_pictureWidth, _pictureHeight)); } } public void DelSet(string name) { if (_lainerStorages.ContainsKey(name)) { _lainerStorages.Remove(name); } } public LainersGenericCollection? this[string ind] { get { if (_lainerStorages.ContainsKey(ind)) { return _lainerStorages[ind]; } return null; } } } }