This commit is contained in:
Кашин Максим 2022-10-20 11:28:49 +04:00
parent 74ae24d23b
commit 3c0124841e
2 changed files with 5 additions and 3 deletions

View File

@ -33,10 +33,12 @@ namespace GasolineTanker
{ {
int index = listBoxMaps.SelectedIndex; int index = listBoxMaps.SelectedIndex;
listBoxMaps.Items.Clear(); listBoxMaps.Items.Clear();
for (int i = 0; i < _mapsCollection.Keys.Count; i++) for (int i = 0; i < _mapsCollection.Keys.Count; i++)
{ {
listBoxMaps.Items.Add(_mapsCollection.Keys[i]); listBoxMaps.Items.Add(_mapsCollection.Keys[i]);
} }
if (listBoxMaps.Items.Count > 0 && (index == -1 || index >= listBoxMaps.Items.Count)) if (listBoxMaps.Items.Count > 0 && (index == -1 || index >= listBoxMaps.Items.Count))
{ {
listBoxMaps.SelectedIndex = 0; listBoxMaps.SelectedIndex = 0;

View File

@ -112,10 +112,10 @@ namespace GasolineTanker
int height = _pictureHeight / _placeSizeHeight; int height = _pictureHeight / _placeSizeHeight;
int i = 0; int i = 0;
foreach (var warship in _setGasolineTanker.GetGasolineTanker()) foreach (var gasolineTanker in _setGasolineTanker.GetGasolineTanker())
{ {
warship.SetObject(i % width * _placeSizeWidth+10, (height - 1 - i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight); gasolineTanker.SetObject(i % width * _placeSizeWidth+10, (height - 1 - i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
warship.DrawningObject(g); gasolineTanker.DrawningObject(g);
i++; i++;
} }
} }