예제 #1
0
 public void addMovementOrder(AbstractMovementOrder order)
 {
     if (!(order is AutomaticMovementOrder))
     {
         RemoveAutomaticOrders();
     }
     movementOrders.Enqueue(MovementOrderToTuple(order));
 }
예제 #2
0
 public MovementOrderTuple(AbstractMovementOrder order, WaypointUI ui)
 {
     this.order = order;
     this.ui    = ui;
     if (order is AutomaticMovementOrder)
     {
         (order as AutomaticMovementOrder).UI = ui;
     }
 }
예제 #3
0
    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);
    }
예제 #4
0
 public MoveFaceOrderTuple(AbstractMovementOrder order, WaypointUI ui, FacingUI facingUI)
     : base(order, ui)
 {
     this.facingUI = facingUI;
 }