public void addMovementOrder(AbstractMovementOrder order) { if (!(order is AutomaticMovementOrder)) { RemoveAutomaticOrders(); } movementOrders.Enqueue(MovementOrderToTuple(order)); }
public MovementOrderTuple(AbstractMovementOrder order, WaypointUI ui) { this.order = order; this.ui = ui; if (order is AutomaticMovementOrder) { (order as AutomaticMovementOrder).UI = ui; } }
MovementOrderTuple MovementOrderToTuple(AbstractMovementOrder order) { WaypointUI ui = SimplePool.Spawn(waypointUI).GetComponent <WaypointUI>(); MovementOrderTuple result; if (order is MoveFaceOrder) { FacingUI facing = SimplePool.Spawn(facingUI).GetComponent <FacingUI>(); result = new MoveFaceOrderTuple(order, ui, facing); facing.Position = order.Position; facing.Direction = (order as MoveFaceOrder).FacingDirection; } else { result = new MovementOrderTuple(order, ui); } ui.Start = movementOrders.Count != 0 ? ui.Start = movementOrders.Last <MovementOrderTuple>().order.Position : (Vector2)(this.transform.position); ui.End = order.Position; return(result); }
public MoveFaceOrderTuple(AbstractMovementOrder order, WaypointUI ui, FacingUI facingUI) : base(order, ui) { this.facingUI = facingUI; }