public void OnInit(GOAPAgent agent) { if (PreconditionInfo.Init) { ((IGOAPInitListener)Precondition).OnInit(agent); } if (ActionInfo.Init) { ((IGOAPInitListener)Action).OnInit(agent); } }
public void OnUpdate(GOAPAgent agent) { if (PreconditionInfo.Update) { ((IGOAPUpdateListener)Precondition).OnUpdate(agent); } if (ActionInfo.Update) { ((IGOAPUpdateListener)Action).OnUpdate(agent); } }
public void OnTerminate(GOAPAgent agent) { if (PreconditionInfo.Terminate) { ((IGOAPTerminateListener)Precondition).OnTerminate(agent); } if (ActionInfo.Terminate) { ((IGOAPTerminateListener)Action).OnTerminate(agent); } }
public void Continue(GOAPAgent agent) { if (actionQueue.Count <= 0) { return; } if (CurrentNode != null) { CurrentNode.OnTerminate(agent); } CurrentNode = actionQueue.Dequeue(); CurrentNode.Precondition.SetVariables(agent.EntityState); CurrentNode.OnInit(agent); }
public virtual void OnTerminate(GOAPAgent agent) { }
public virtual void OnUpdate(GOAPAgent agent) { }
public virtual void OnInit(GOAPAgent agent) { }
public void ForceEnqueue(GOAPAgent agent, Precondition precondition) { var action = agent.GetBestActionFor(precondition); actionQueue.Enqueue(new GOAPPlanNode(action, precondition)); }
public void Init(GOAPAgent agent) { Continue(agent); }
public abstract bool IsPossible(GOAPAgent agent, EntityState state);
public abstract float CalculateMotivation(GOAPAgent agent);
public abstract float CalculateCost(GOAPAgent agent);