2022-09-11 18:05:41 +04:00
|
|
|
|
namespace ArmoredVehicle
|
|
|
|
|
{
|
|
|
|
|
internal class DrawningObject : IDrawningObject
|
|
|
|
|
{
|
|
|
|
|
private DrawingArmoredVehicle _machine = null;
|
|
|
|
|
|
2022-09-12 19:23:19 +04:00
|
|
|
|
public DrawningObject(DrawingArmoredVehicle machine)
|
2022-09-11 18:05:41 +04:00
|
|
|
|
{
|
2022-09-12 19:23:19 +04:00
|
|
|
|
_machine = machine;
|
2022-09-11 18:05:41 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Step => _machine?.ArmoredVehicle?.Step ?? 0;
|
|
|
|
|
|
|
|
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
|
|
|
{
|
|
|
|
|
return _machine?.GetCurrentPosition() ?? default;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void MoveObject(Direction direction)
|
|
|
|
|
{
|
|
|
|
|
_machine?.MoveTransport(direction);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetObject(int x, int y, int width, int height)
|
|
|
|
|
{
|
|
|
|
|
_machine.SetPosition(x, y, width, height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IDrawningObject.DrawningObject(Graphics g)
|
|
|
|
|
{
|
|
|
|
|
_machine.DrawTransport(g);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|