PIbd-22_DozorovaAA_ArmoredV.../ArmoredVehicle/DrawningObject.cs
2022-09-12 19:23:19 +04:00

34 lines
881 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);
}
}
}