using Bulldozer; using ProjectBulldozer.MovementStrategy; namespace ProjectBulldozer.Drawning { public class DrawingObjectTractor : IMoveableObject { private readonly DrawingTractor? _drawningTractor = null; public DrawingObjectTractor(DrawingTractor drawningTractor) { _drawningTractor = drawningTractor; } public ObjectParameters? GetObjectPosition { get { if (_drawningTractor == null || _drawningTractor.EntityTractor == null) { return null; } return new ObjectParameters(_drawningTractor.GetPosX, _drawningTractor.GetPosY, _drawningTractor.GetWidth, _drawningTractor.GetHeight); } } public int GetStep => (int)(_drawningTractor?.EntityTractor?.Step ?? 0); public bool CheckCanMove(DirectionType direction) => _drawningTractor?.CanMove(direction) ?? false; public void MoveObject(DirectionType direction) => _drawningTractor?.MoveTransport(direction); } }