예제 #1
0
 public Order(OrderTarget target, Action <OrderTarget> orderAction, NPC orderTarget)
 {
     Target           = target;
     this.orderAction = orderAction;
     this.orderTarget = orderTarget;
     executed         = false;
 }
예제 #2
0
 public void GiveOrder(Order order, OrderTarget target)
 {
     OrdersSequence.Enqueue(order);
     if (OrdersSequence.Count == 1)
     {
         order.Execute();
     }
 }
예제 #3
0
        public Order AssembleOrder(OrderTarget target, Action <OrderTarget> orderAction, Predicate <NPC> completeCondition)
        {
            Order order = new Order
                          (
                target,
                orderAction,
                this
                          );

            order.CompleteCondition = completeCondition;
            order.OnComplete       += delegate { Debug.Log("Complete"); };
            order.OnComplete       += delegate { OrdersSequence.Dequeue(); };
            order.OnComplete       += delegate { RefreshOrders(); };
            return(order);
        }