Первая лабораторная работа.( Добавление проверки Set Position)
This commit is contained in:
parent
cbf0ed1e2f
commit
0776eb1254
@ -32,11 +32,18 @@ namespace AirFighter
|
||||
public void SetPosition(int x, int y, int width, int height)
|
||||
{
|
||||
|
||||
// Check if coords inside the picture
|
||||
_startPosX = x;
|
||||
_startPosY = y;
|
||||
_pictureWidth = width;
|
||||
_pictureHeight = height;
|
||||
if (x > width || x < 0 || y > height || y< 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
_startPosX = x;
|
||||
_startPosY = y;
|
||||
_pictureWidth = width;
|
||||
_pictureHeight = height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void MoveTransport(Direction direction)
|
||||
|
Loading…
x
Reference in New Issue
Block a user