PIbd-22_DozorovaAA_ArmoredV.../ArmoredVehicle/DrawningObject.cs
2022-09-21 14:05:06 +04:00

35 lines
882 B
C#

namespace ArmoredVehicle
{
internal class DrawningObject : IDrawningObject
{
private DrawingArmoredVehicle _machine = null;
public DrawningObject(DrawingArmoredVehicle machine)
{
_machine = machine;
}
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);
}
}
}