From 60ee97faad033bd6b4c5ffe9e90e5b7b8241dd11 Mon Sep 17 00:00:00 2001 From: Timourka Date: Tue, 24 Oct 2023 09:10:04 +0400 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BD=D0=BE=D0=B2=D0=B0=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D1=8B=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Laba1Loco/Laba1Loco/TrainsGenericStorage.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Laba1Loco/Laba1Loco/TrainsGenericStorage.cs b/Laba1Loco/Laba1Loco/TrainsGenericStorage.cs index 11fb3e3..c581eb7 100644 --- a/Laba1Loco/Laba1Loco/TrainsGenericStorage.cs +++ b/Laba1Loco/Laba1Loco/TrainsGenericStorage.cs @@ -11,11 +11,11 @@ namespace Laba1Loco /// /// Словарь (хранилище) /// - readonly Dictionary> _carStorages; + readonly Dictionary> _trainStorages; /// /// Возвращение списка названий наборов /// - public List Keys => _carStorages.Keys.ToList(); + public List Keys => _trainStorages.Keys.ToList(); /// /// Ширина окна отрисовки /// @@ -31,7 +31,7 @@ namespace Laba1Loco /// public TrainsGenericStorage(int pictureWidth, int pictureHeight) { - _carStorages = new Dictionary>(); + _trainStorages = new Dictionary>(); _pictureWidth = pictureWidth; _pictureHeight = pictureHeight; } @@ -41,9 +41,9 @@ namespace Laba1Loco /// Название набора public void AddSet(string name) { - if (_carStorages.ContainsKey(name)) + if (_trainStorages.ContainsKey(name)) return; - _carStorages[name] = new TrainsGenericCollection(_pictureWidth, _pictureHeight); + _trainStorages[name] = new TrainsGenericCollection(_pictureWidth, _pictureHeight); } /// /// Удаление набора @@ -51,9 +51,9 @@ namespace Laba1Loco /// Название набора public void DelSet(string name) { - if (!_carStorages.ContainsKey(name)) + if (!_trainStorages.ContainsKey(name)) return; - _carStorages.Remove(name); + _trainStorages.Remove(name); } /// /// Доступ к набору @@ -65,8 +65,8 @@ namespace Laba1Loco { get { - if (_carStorages.ContainsKey(ind)) - return _carStorages[ind]; + if (_trainStorages.ContainsKey(ind)) + return _trainStorages[ind]; return null; } }