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