43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GasolineTanker
|
|
{
|
|
internal class DrawingObjectGasolineTanker : IDrawingObject
|
|
{
|
|
private DrawingGasolineTanker _gasolineTanker = null;
|
|
|
|
public DrawingObjectGasolineTanker(DrawingGasolineTanker gasolineTanker)
|
|
{
|
|
_gasolineTanker = gasolineTanker;
|
|
}
|
|
|
|
public float Step => _gasolineTanker?.GasolineTanker?.Step ?? 0;
|
|
|
|
public (float Left, float Right, float Top, float Bottom) GetCurrentPosition()
|
|
{
|
|
return _gasolineTanker?.GetCurrentPosition() ?? default;
|
|
}
|
|
|
|
public void MoveObject(Direction direction)
|
|
{
|
|
_gasolineTanker?.MoveTransport(direction);
|
|
}
|
|
|
|
public void SetObject(int x, int y, int width, int height)
|
|
{
|
|
_gasolineTanker.SetPosition(x, y, width, height);
|
|
}
|
|
|
|
void IDrawingObject.DrawningObject(Graphics g)
|
|
{
|
|
_gasolineTanker.DrawTransport(g);
|
|
}
|
|
public string GetInfo() => _gasolineTanker?.GetDataForSave();
|
|
public static IDrawingObject Create(string data) => new DrawingObjectGasolineTanker(data.CreateDrawingGasolineTanker());
|
|
}
|
|
}
|