package ProjectStormtrooper; public class DrawingObjectPlane implements IMoveableObject { private DrawingPlane _drawingPlane; public DrawingObjectPlane(DrawingPlane drawingPlane) { _drawingPlane = drawingPlane; } @Override public ObjectParameters GetObjectPosition() { if (_drawingPlane == null || _drawingPlane.EntityPlane == null) { return null; } return new ObjectParameters( _drawingPlane.GetPosX(), _drawingPlane.GetPosY(), _drawingPlane.GetWidth(), _drawingPlane.GetHeight() ); } @Override public int GetStep() { if (_drawingPlane != null) if (_drawingPlane.EntityPlane != null) return (int) _drawingPlane.EntityPlane.Step(); return 0; } @Override public boolean CheckCanMove(EnumDirectionType direction) { if (_drawingPlane == null) return false; return _drawingPlane.CanMove(direction); } @Override public void MoveObject(EnumDirectionType direction) { if (_drawingPlane != null) _drawingPlane.MoveTransport(direction); } }