Class BehaviorKnowledge
Behavior logic component knowledge data container. Contains blackboard values, sensors data and goals storage for Behavior Tree execution.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/AI/BehaviorKnowledge.h
Syntax
public class BehaviorKnowledge : public ScriptingObject
Methods
AddGoal(Variant&& goal)
Adds the goal to the knowledge. If goal of that type already exists then it's value is updated.
Declaration
public void AddGoal(Variant&& goal)
Parameters
Variant
goal
The goal value to add/set. |
CompareValues(float a, float b, BehaviorValueComparison comparison)
Compares two values and returns the comparision result.
Declaration
public static bool CompareValues(float a, float b, BehaviorValueComparison comparison)
Parameters
float
a
The left operand. |
float
b
The right operand. |
BehaviorValueComparison
comparison
The comparison function. |
Returns
bool
True if comparision passed, otherwise false. |
FreeMemory()
Releases the memory of the knowledge.
Declaration
public void FreeMemory()
Get(const StringAnsiView& path, Variant& value)
Gets the knowledge item value via selector path.
Declaration
public bool Get(const StringAnsiView& path, Variant& value) const
Parameters
StringAnsiView
path
Selector path. |
Variant
value
Result value (valid only when returned true). |
Returns
bool
True if got value, otherwise false. |
See Also
GetGoal(ScriptingTypeHandle type)
Gets the goal from the knowledge.
Declaration
public Variant GetGoal(ScriptingTypeHandle type) const
Parameters
ScriptingTypeHandle
type
The goal type. |
Returns
Variant
The goal value or null if not found. |
HasGoal()
Checks if knowledge has a given goal (exact type match without base class check).
Declaration
public bool HasGoal()
Returns
bool
True if knowledge has a given goal, otherwise false. |
Type Parameters
typename T
|
HasGoal(ScriptingTypeHandle type)
Checks if knowledge has a given goal (exact type match without base class check).
Declaration
public bool HasGoal(ScriptingTypeHandle type) const
Parameters
ScriptingTypeHandle
type
The goal type. |
Returns
bool
True if knowledge has a given goal, otherwise false. |
InitMemory(BehaviorTree* tree)
Initializes the knowledge for a certain tree.
Declaration
public void InitMemory(BehaviorTree* tree)
Parameters
BehaviorTree
tree
|
RemoveGoal()
Removes the goal from the knowledge. Does nothing if goal of the given type doesn't exist in the knowledge.
Declaration
public void RemoveGoal()
Returns
void
|
Type Parameters
typename T
|
RemoveGoal(ScriptingTypeHandle type)
Removes the goal from the knowledge. Does nothing if goal of the given type doesn't exist in the knowledge.
Declaration
public void RemoveGoal(ScriptingTypeHandle type)
Parameters
ScriptingTypeHandle
type
The goal type. |
Set(const StringAnsiView& path, const Variant& value)
Sets the knowledge item value via selector path.
Declaration
public bool Set(const StringAnsiView& path, const Variant& value)
Parameters
StringAnsiView
path
Selector path. |
Variant
value
Value to set. |
Returns
bool
True if set value, otherwise false. |