From 7082b3197b9ea2d7becb9b7a443c24b4c756ca51 Mon Sep 17 00:00:00 2001 From: Danil Malin Date: Tue, 18 Oct 2022 17:42:24 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=B1=D0=B0=D0=B3?= =?UTF-8?q?=D0=B0=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D0=BC=D0=B5=D1=80=D0=B0=20=D1=81=D0=BF=D0=B8=D1=81?= =?UTF-8?q?=D0=BA=D0=B0,=20=D1=83=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D1=85=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarmlyLocomotive/FormMapWithSetLocomotives.cs | 4 ++-- .../WarmlyLocomotive/MapWithSetLocomotivesGeneric.cs | 2 +- WarmlyLocomotive/WarmlyLocomotive/MapsCollection.cs | 2 -- WarmlyLocomotive/WarmlyLocomotive/SetLocomotivesGeneric.cs | 7 ------- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/WarmlyLocomotive/WarmlyLocomotive/FormMapWithSetLocomotives.cs b/WarmlyLocomotive/WarmlyLocomotive/FormMapWithSetLocomotives.cs index 5e890ab..44686b3 100644 --- a/WarmlyLocomotive/WarmlyLocomotive/FormMapWithSetLocomotives.cs +++ b/WarmlyLocomotive/WarmlyLocomotive/FormMapWithSetLocomotives.cs @@ -74,8 +74,8 @@ namespace WarmlyLocomotive FormLocomotive form = new(); if (form.ShowDialog() == DialogResult.OK) { - DrawningObjectLocomotive car = new(form.SelectedLocomotive); - if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + car != -1) + DrawningObjectLocomotive locomotive = new(form.SelectedLocomotive); + if (_mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty] + locomotive != -1) { MessageBox.Show("Объект добавлен"); pictureBox.Image = _mapsCollection[listBoxMaps.SelectedItem?.ToString() ?? string.Empty].ShowSet(); diff --git a/WarmlyLocomotive/WarmlyLocomotive/MapWithSetLocomotivesGeneric.cs b/WarmlyLocomotive/WarmlyLocomotive/MapWithSetLocomotivesGeneric.cs index ab5b5d2..c5cf58b 100644 --- a/WarmlyLocomotive/WarmlyLocomotive/MapWithSetLocomotivesGeneric.cs +++ b/WarmlyLocomotive/WarmlyLocomotive/MapWithSetLocomotivesGeneric.cs @@ -42,7 +42,7 @@ namespace WarmlyLocomotive /// public MapWithSetLocomotivesGeneric(int picWidth, int picHeight, U map) { - int width = picWidth / _placeSizeWidth; + int width = picWidth / (_placeSizeWidth + 30); int height = picHeight / _placeSizeHeight; _setLocomotives = new SetLocomotivesGeneric(width * height); _pictureWidth = picWidth; diff --git a/WarmlyLocomotive/WarmlyLocomotive/MapsCollection.cs b/WarmlyLocomotive/WarmlyLocomotive/MapsCollection.cs index e172901..6abc264 100644 --- a/WarmlyLocomotive/WarmlyLocomotive/MapsCollection.cs +++ b/WarmlyLocomotive/WarmlyLocomotive/MapsCollection.cs @@ -56,7 +56,6 @@ namespace WarmlyLocomotive /// Название карты public void DelMap(string name) { - // TODO Прописать логику для удаления if (_mapStorages.ContainsKey(name)) { _mapStorages.Remove(name); @@ -71,7 +70,6 @@ namespace WarmlyLocomotive { get { - // TODO Продумать логику получения объекта if (ind != String.Empty) { MapWithSetLocomotivesGeneric value; diff --git a/WarmlyLocomotive/WarmlyLocomotive/SetLocomotivesGeneric.cs b/WarmlyLocomotive/WarmlyLocomotive/SetLocomotivesGeneric.cs index edcd3c2..b8c7371 100644 --- a/WarmlyLocomotive/WarmlyLocomotive/SetLocomotivesGeneric.cs +++ b/WarmlyLocomotive/WarmlyLocomotive/SetLocomotivesGeneric.cs @@ -34,8 +34,6 @@ namespace WarmlyLocomotive /// public int Insert(T locomotive) { - // TODO вставка в начало набора - // TODO проверка на _maxCount if (_maxCount == Count) { return -1; @@ -51,8 +49,6 @@ namespace WarmlyLocomotive /// public int Insert(T locomotive, int position) { - // TODO проверка позиции - // TODO вставка по позиции if (position < 0 || position >= Count || _maxCount == Count) { return -1; @@ -67,7 +63,6 @@ namespace WarmlyLocomotive /// public T Remove(int position) { - // TODO проверка позиции if (position < 0 || position >= Count) { return null; @@ -93,8 +88,6 @@ namespace WarmlyLocomotive } set { - // TODO проверка позиции - // TODO вставка в список по позиции if (position >= 0 && position < Count) { _places[position] = value;