using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using ProjectAirFighter.DrawningObjects; namespace ProjectAirFighter.MovementStrategy { public class DrawningObjectAirplane: IMoveableObject { private readonly DrawningAirplane? _drawningAirplane = null; public DrawningObjectAirplane(DrawningAirplane drawningAirplane) { _drawningAirplane = drawningAirplane; } public ObjectParameters? GetObjectPosition { get { if (_drawningAirplane == null || _drawningAirplane.EntityAirplane == null) { return null; } return new ObjectParameters(_drawningAirplane.GetPosX, _drawningAirplane.GetPosY, _drawningAirplane.GetWidth, _drawningAirplane.GetHeight); } } public int GetStep => (int)(_drawningAirplane?.EntityAirplane?.Step ?? 0); public bool CheckCanMove(DirectionType direction) => _drawningAirplane?.CanMove(direction) ?? false; public void MoveObject(DirectionType direction) => _drawningAirplane?.MoveTransport(direction); } }