public Order(OrderTarget target, Action <OrderTarget> orderAction, NPC orderTarget) { Target = target; this.orderAction = orderAction; this.orderTarget = orderTarget; executed = false; }
public void GiveOrder(Order order, OrderTarget target) { OrdersSequence.Enqueue(order); if (OrdersSequence.Count == 1) { order.Execute(); } }
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); }