Grail (C#)  1.4.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Planners.Goal Class Referenceabstract

Represents a planner's goal to achieve, used by Reasoners.PlannerReasoner. A single planning problem may have multiple Goals defined. More...

Public Member Functions

abstract bool IsReached (AIEntity entity)
 Determines if the goal has been satisfied for the provided AIEntity. More...
 
abstract void SetPlanSpaceConditions (Planner planner, ObjectIndexBinding binding)
 In this method, all plan-space goal conditions should be set. More...
 
virtual void OnChosen (AIEntity goalPursuer)
 Called after the Goal is set by the reasoner.
Put your custom logic, if needed. Te base implementation is empty. More...
 
virtual void OnReached (AIEntity goalPursuer)
 Called by the PlannerReasoner after the Goal.IsReached() method returns true.
Put your custom logic, if needed. Te base implementation is empty. More...
 
virtual void OnReapplied (AIEntity goalPursuer)
 Called if the current plan has failed to achieve this Goal but it got chosen once again.
Put your custom logic, if needed. Te base implementation is empty. More...
 

Public Attributes

virtual PlannerHeuristic Heuristic => null
 

Detailed Description

Represents a planner's goal to achieve, used by Reasoners.PlannerReasoner. A single planning problem may have multiple Goals defined.

Member Function Documentation

◆ IsReached()

abstract bool Grail.Planners.Goal.IsReached ( AIEntity  entity)
pure virtual

Determines if the goal has been satisfied for the provided AIEntity.

Parameters
entityThe AIEntity object to test the achievement of the goal for.
Returns

◆ OnChosen()

virtual void Grail.Planners.Goal.OnChosen ( AIEntity  goalPursuer)
inlinevirtual

Called after the Goal is set by the reasoner.
Put your custom logic, if needed. Te base implementation is empty.

Parameters
goalPursuerThe entity that has chosen this goal

◆ OnReached()

virtual void Grail.Planners.Goal.OnReached ( AIEntity  goalPursuer)
inlinevirtual

Called by the PlannerReasoner after the Goal.IsReached() method returns true.
Put your custom logic, if needed. Te base implementation is empty.

Parameters
goalPursuerThe entity that has chosen this goal

◆ OnReapplied()

virtual void Grail.Planners.Goal.OnReapplied ( AIEntity  goalPursuer)
inlinevirtual

Called if the current plan has failed to achieve this Goal but it got chosen once again.
Put your custom logic, if needed. Te base implementation is empty.

Parameters
goalPursuerThe entity that has chosen this goal

◆ SetPlanSpaceConditions()

abstract void Grail.Planners.Goal.SetPlanSpaceConditions ( Planner  planner,
ObjectIndexBinding  binding 
)
pure virtual

In this method, all plan-space goal conditions should be set.

Parameters
plannerThe planner to be provided with goal conditions. Use Planner.PushCondition method.
bindingThe binding between planer and game objects. See ObjectIndexBinding.

The documentation for this class was generated from the following file: