PIbd-21_Valitov_D.F_Sailboa.../Sailboat/DrawingObjectBoat.cs

41 lines
944 B
C#
Raw Normal View History

2023-03-18 02:49:20 +04:00
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()
{
2023-04-13 16:43:46 +04:00
return _boat?.GetCurrentPosition() ?? default;
2023-03-18 02:49:20 +04:00
}
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);
}
}
}