From a92d29b24288a2106d882648fef8417a95dd52b7 Mon Sep 17 00:00:00 2001 From: AparyanLuiza Date: Thu, 30 Nov 2023 02:42:08 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20TractorGenericS?= =?UTF-8?q?torage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Generics/TractorGenericStorage.cs | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 ProjectBulldozer/Generics/TractorGenericStorage.cs diff --git a/ProjectBulldozer/Generics/TractorGenericStorage.cs b/ProjectBulldozer/Generics/TractorGenericStorage.cs new file mode 100644 index 0000000..1ad1526 --- /dev/null +++ b/ProjectBulldozer/Generics/TractorGenericStorage.cs @@ -0,0 +1,46 @@ +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 + { + + } + } + } +}