Первая лабораторная работа.( Добавление проверки 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)
|
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)
|
||||||
_startPosX = x;
|
{
|
||||||
_startPosY = y;
|
return;
|
||||||
_pictureWidth = width;
|
}
|
||||||
_pictureHeight = height;
|
else
|
||||||
|
{
|
||||||
|
_startPosX = x;
|
||||||
|
_startPosY = y;
|
||||||
|
_pictureWidth = width;
|
||||||
|
_pictureHeight = height;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void MoveTransport(Direction direction)
|
public void MoveTransport(Direction direction)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user