using ProjectBulldozer.Drawning; namespace ProjectBulldozer.Generics { internal class TractorGenericStorage { readonly Dictionary> _TractorsStorage; public List Keys => _TractorsStorage.Keys.ToList(); private readonly int _pictureWidth; private readonly int _pictureHeight; public TractorGenericStorage(int pictureWidth, int pictureHeight) { _TractorsStorage = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } public void AddSet(string name) { if (!_TractorsStorage.ContainsKey(name)) { _TractorsStorage.Add(name, new TractorGenericCollection(_pictureWidth, _pictureHeight)); } } public void DelSet(string name) { if (_TractorsStorage.ContainsKey(name)) { _TractorsStorage.Remove(name); } } public TractorGenericCollection? this[string ind] { get { if (_TractorsStorage.ContainsKey(ind)) { return _TractorsStorage[ind]; } return null; } } } }