using System; using UnityEngine; public class IsFirstInTheQueue : Condition { // ================== CONSTRUCTOR ================== public IsFirstInTheQueue() : base("Is First In Queue") { } // ================== CONDITION ================== public override bool IsConditionMet(HTNPlanner planner) { Worldstate worldstate = planner.WorldState; if (worldstate != null) { //Cast Customer c = planner.Agent as Customer; if (c != null) return worldstate.Get<PaymentArea>("PaymentArea").IsFirstInQueue(c); else { Debug.LogError("Cast Failed!"); return false; } } else { Debug.LogError("The worldstate is Null!"); return false; } } }