Exemple #1
0
 public void OnInit(GOAPAgent agent)
 {
     if (PreconditionInfo.Init)
     {
         ((IGOAPInitListener)Precondition).OnInit(agent);
     }
     if (ActionInfo.Init)
     {
         ((IGOAPInitListener)Action).OnInit(agent);
     }
 }
Exemple #2
0
 public void OnUpdate(GOAPAgent agent)
 {
     if (PreconditionInfo.Update)
     {
         ((IGOAPUpdateListener)Precondition).OnUpdate(agent);
     }
     if (ActionInfo.Update)
     {
         ((IGOAPUpdateListener)Action).OnUpdate(agent);
     }
 }
Exemple #3
0
 public void OnTerminate(GOAPAgent agent)
 {
     if (PreconditionInfo.Terminate)
     {
         ((IGOAPTerminateListener)Precondition).OnTerminate(agent);
     }
     if (ActionInfo.Terminate)
     {
         ((IGOAPTerminateListener)Action).OnTerminate(agent);
     }
 }
Exemple #4
0
 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);
 }
Exemple #5
0
 public virtual void OnTerminate(GOAPAgent agent)
 {
 }
Exemple #6
0
 public virtual void OnUpdate(GOAPAgent agent)
 {
 }
Exemple #7
0
 public virtual void OnInit(GOAPAgent agent)
 {
 }
Exemple #8
0
        public void ForceEnqueue(GOAPAgent agent, Precondition precondition)
        {
            var action = agent.GetBestActionFor(precondition);

            actionQueue.Enqueue(new GOAPPlanNode(action, precondition));
        }
Exemple #9
0
 public void Init(GOAPAgent agent)
 {
     Continue(agent);
 }
Exemple #10
0
 public abstract bool IsPossible(GOAPAgent agent, EntityState state);
Exemple #11
0
 public abstract float CalculateMotivation(GOAPAgent agent);
Exemple #12
0
 public abstract float CalculateCost(GOAPAgent agent);