41 lines
928 B
C#
41 lines
928 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Ship
|
|
{
|
|
internal class DrawingObject : IDrawingObject
|
|
{
|
|
private DrawingShip _ship = null;
|
|
|
|
public DrawingObject(DrawingShip ship)
|
|
{
|
|
_ship = ship;
|
|
}
|
|
|
|
public float Step => _ship?.Ship?.Step ?? 0;
|
|
|
|
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);
|
|
}
|
|
|
|
void IDrawingObject.DrawningObject(Graphics g)
|
|
{
|
|
_ship.DrawTransport(g);
|
|
}
|
|
}
|
|
}
|