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); + } + } +}