protected override bool Run(GoapAgent agent) { if (Move()) { RunOver(); } return(true); }
public virtual void PlanFailed(HashSet <KeyValuePair <string, object> > goals) { if (ShowPlanState) { string str = "<color=red>Plan failed</color>\n"; str += "[ " + GoapAgent.PrettyGoals(goals) + " ]"; Debug.Log(str); } }
public virtual void PlanFound(HashSet <KeyValuePair <string, object> > goals, Stack <GoapAction> plan) { if (ShowPlanState) { int cost = 0; foreach (var action in plan) { cost += action.Cost; } string str = "<color=green>Plan found</color>\n"; str += "[ " + GoapAgent.PrettyPlan(plan) + " ]"; str += " --> [ " + GoapAgent.PrettyGoals(goals) + " ]\n"; str += "cost: " + cost.ToString(); Debug.Log(str); } }
private void Awake() { Agent = GetComponent <GoapAgent>(); Init(); }
protected override bool Exit(GoapAgent agent) { return(true); }
public override bool CheckProceduralPrecondition(GoapAgent agent) { return(DestTarget != null); }
public GoapPlanner(GoapAgent agent) { _agent = agent; }
protected abstract bool Exit(GoapAgent agent);
protected abstract bool Run(GoapAgent agent);
public abstract bool CheckProceduralPrecondition(GoapAgent agent);//TODO: change to coroutine protected abstract bool Enter(GoapAgent agent);
//protected abstract void SpecificReset(); // since we have Exit(), it no longer needed public abstract bool CheckProceduralPrecondition(GoapAgent agent);//TODO: change to coroutine
public bool DoRun(GoapAgent agent) { return(Run(agent)); }