Первая лабораторная работа.( Добавление проверки Set Position)

This commit is contained in:
Yuee Shiness 2022-09-12 20:32:39 +04:00
parent cbf0ed1e2f
commit 0776eb1254

View File

@ -32,13 +32,20 @@ namespace AirFighter
public void SetPosition(int x, int y, int width, int height)
{
// Check if coords inside the picture
if (x > width || x < 0 || y > height || y< 0)
{
return;
}
else
{
_startPosX = x;
_startPosY = y;
_pictureWidth = width;
_pictureHeight = height;
}
}
public void MoveTransport(Direction direction)
{
if (!_pictureWidth.HasValue || !_pictureHeight.HasValue)