PIbd-22_DozorovaAA_ArmoredV.../ArmoredVehicle/DrawningObject.cs
2022-09-11 18:05:41 +04:00

34 lines
873 B
C#

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