From 64280d0b6fa819cec0e1b4927e913e930e410720 Mon Sep 17 00:00:00 2001 From: "A.Novopoltsev" Date: Mon, 21 Nov 2022 20:15:15 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5?= =?UTF-8?q?=D0=B9=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Warship/Warship/DrawningObjectLinkor.cs | 40 +++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Warship/Warship/DrawningObjectLinkor.cs diff --git a/Warship/Warship/DrawningObjectLinkor.cs b/Warship/Warship/DrawningObjectLinkor.cs new file mode 100644 index 0000000..f99fd88 --- /dev/null +++ b/Warship/Warship/DrawningObjectLinkor.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Warship +{ + public class DrawningObjectLinkor : IDrawningObject + { + private DrawningShip _ship; + + public DrawningObjectLinkor(DrawningShip ship) + { + _ship = ship; + } + + public float Step => _ship.Ship.Step; + + public void DrawningObject(Graphics g) + { + _ship.DrawTransport(g); + } + + public (float Left, float Right, float Top, float Bottom) GetCurrentPosition() + { + return _ship?.GetCurrentPosition() ?? default; + } + + public void MoveObject(Direction direction) + { + _ship.MoveTransport(direction); + } + + public void SetObject(int x, int y, int width, int height) + { + _ship.SetPosition(x, y, width, height); + } + } +}