Добавление интерфейса

This commit is contained in:
A.Novopoltsev 2022-11-21 20:15:15 +03:00
parent 8c5844e23b
commit 64280d0b6f

View File

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