From 0776eb1254043da0f6377c48805041984ef37062 Mon Sep 17 00:00:00 2001 From: Yuee Shiness Date: Mon, 12 Sep 2022 20:32:39 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B2=D0=B0=D1=8F=20=D0=BB?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0.(=20=D0=94=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20Set=20Position)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirFighter/DrawingAircraft.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/AirFighter/DrawingAircraft.cs b/AirFighter/DrawingAircraft.cs index 044b635..b0f3678 100644 --- a/AirFighter/DrawingAircraft.cs +++ b/AirFighter/DrawingAircraft.cs @@ -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)