This commit is contained in:
Daniya_Youdakova 2022-12-24 21:55:45 +04:00
parent cfc4fe61b7
commit f8db0d8b7e

View File

@ -66,7 +66,6 @@ namespace AircraftCarrier
}
}
break;
case Direction.Down:
xNumOfCells = (int)Math.Ceiling((Right - Left) / _size_x);
yNumOfCells = (int)Math.Ceiling(_drawningObject.Step / _size_y);
@ -93,7 +92,6 @@ namespace AircraftCarrier
}
}
break;
case Direction.Left:
xNumOfCells = (int)Math.Ceiling(_drawningObject.Step / _size_x);
yNumOfCells = (int)Math.Ceiling((Bottom - Top) / _size_y);
@ -120,13 +118,11 @@ namespace AircraftCarrier
}
}
break;
case Direction.Right:
xNumOfCells = (int)Math.Ceiling(_drawningObject.Step / _size_x);
yNumOfCells = (int)Math.Ceiling((Bottom - Top) / _size_y);
xObjOffset = (int)(Right / _size_x);
yObjOffset = (int)Math.Ceiling(Top / _size_y);
for (int i = 0; i < yNumOfCells; i++)
{
if (!roadIsClear)
@ -148,7 +144,6 @@ namespace AircraftCarrier
}
break;
}
if (roadIsClear)
{
_drawningObject.MoveObject(direction);
@ -186,6 +181,7 @@ namespace AircraftCarrier
y += (int)_size_y;
yObjOffset = (int)(y / _size_y);
}
return false;
}
private bool AreaIsFree(int xNumOfCells, int yNumOfCells, int xObjOffset, int yObjOffset)
@ -206,7 +202,6 @@ namespace AircraftCarrier
}
return true;
}
private Bitmap DrawMapWithObject()
{
Bitmap bmp = new(_width, _height);