финальные изменения

This commit is contained in:
foxkerik6 2022-11-29 00:26:24 +04:00
parent d740eda7c3
commit fa6ac61b63
2 changed files with 16 additions and 9 deletions

View File

@ -88,7 +88,7 @@ namespace Stormtrooper
/// <returns></returns>
public Bitmap ShowOnMap()
{
foreach (var air in _setAirs.GetBoats())
foreach (var air in _setAirs.GetAirs())
{
return _map.CreateMap(_pictureWidth, _pictureHeight, air);
}
@ -168,15 +168,22 @@ namespace Stormtrooper
int currentHeight = 0;
int i = 0;
foreach (var air in _setAirs.GetBoats())
foreach (var air in _setAirs.GetAirs())
{
air.SetObject(currentWidth * _placeSizeWidth,
air?.SetObject(currentWidth * _placeSizeWidth,
currentHeight * _placeSizeHeight,
_pictureWidth, _pictureHeight);
air.DrawningObject(g);
air?.DrawningObject(g);
i++;
if (currentWidth > 0)
currentWidth--;
else
{
currentWidth = width - 1;
currentHeight++;
}
if (currentHeight > height) return;
}
}
}

View File

@ -90,13 +90,13 @@ namespace Stormtrooper
}
}
public IEnumerable<T> GetBoats()
public IEnumerable<T> GetAirs()
{
foreach (var boat in _places)
foreach (var air in _places)
{
if (boat != null)
if (air != null)
{
yield return boat;
yield return air;
}
else
{