35 lines
922 B
C#
35 lines
922 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Boats
|
|
{
|
|
internal class DrawingObjectBoat : IDrawingObject
|
|
{
|
|
private DrawingBoat _boat = null;
|
|
public DrawingObjectBoat(DrawingBoat boat)
|
|
{
|
|
_boat = boat;
|
|
}
|
|
public float Step => _boat?.Boat?.Step ?? 0;
|
|
public (float Left, float Top, float Right, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _boat?.GetCurrentPosition() ?? default;
|
|
}
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_boat?.MoveTransport(direction);
|
|
}
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_boat.SetPosition(x, y, width, height);
|
|
}
|
|
public void DrawingObject(Graphics g)
|
|
{
|
|
_boat.DrawTransport(g);
|
|
}
|
|
}
|
|
}
|