Kashin M.I. Lab work 4 #4

Merged
eegov merged 4 commits from LabWork04 into LabWork03 2022-10-21 09:34:24 +04:00
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 3c0124841e - Show all commits

View File

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

View File

@ -112,10 +112,10 @@ namespace GasolineTanker
int height = _pictureHeight / _placeSizeHeight;
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);
warship.DrawningObject(g);
gasolineTanker.SetObject(i % width * _placeSizeWidth+10, (height - 1 - i / width) * _placeSizeHeight + 10, _pictureWidth, _pictureHeight);
gasolineTanker.DrawningObject(g);
i++;
}
}