33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Lab.DrawningObjects;
|
|||
|
|
|||
|
namespace Lab.MovementStrategy
|
|||
|
{
|
|||
|
public class DrawingObjectTanker : IMoveableObject
|
|||
|
{
|
|||
|
private readonly DrawTanker? _drawTanker = null;
|
|||
|
public DrawingObjectTanker(DrawTanker drawTanker )
|
|||
|
{
|
|||
|
_drawTanker = drawTanker;
|
|||
|
}
|
|||
|
|
|||
|
public ObjectParameters? GetObjectParameters
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (_drawTanker == null || _drawTanker.GasolineTanker == null)
|
|||
|
return null;
|
|||
|
return new ObjectParameters(_drawTanker.GetPosX, _drawTanker.GetPosY, _drawTanker.GetWidth, _drawTanker.GetHeight);
|
|||
|
}
|
|||
|
}
|
|||
|
public int GetStep => (int)(_drawTanker?.GasolineTanker?.Step ?? 0);
|
|||
|
public bool CheckCanMove(Direction direction) => _drawTanker?.CanMove(direction) ?? false;
|
|||
|
public void MoveObject(Direction direction) => _drawTanker?.MoveTransport(direction);
|
|||
|
|
|||
|
}
|
|||
|
}
|