Class BehaviorKnowledge
Behavior logic component knowledge data container. Contains blackboard values, sensors data and goals storage for Behavior Tree execution.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public class BehaviorKnowledge : Object
Constructors
BehaviorKnowledge()
Properties
Behavior
Owning Behavior instance (constant).
Declaration
[Unmanaged]
public Behavior Behavior { get; }
Property Value
Behavior
|
Blackboard
Instance of the behaviour blackboard (structure or class).
Declaration
[Unmanaged]
public object Blackboard { get; set; }
Property Value
System.Object
|
Goals
List of all active goals of the behaviour (structure or class).
Declaration
[Unmanaged]
public object[] Goals { get; set; }
Property Value
System.Object[]
|
Tree
Used Behavior Tree asset (defines blackboard and memory constraints).
Declaration
[Unmanaged]
public BehaviorTree Tree { get; }
Property Value
BehaviorTree
|
Methods
AddGoal(Object)
Adds the goal to the knowledge. If goal of that type already exists then it's value is updated.
Declaration
[Unmanaged]
public void AddGoal(object goal)
Parameters
System.Object
goal
The goal value to add/set. |
CompareValues(Single, Single, BehaviorValueComparison)
Compares two values and returns the comparision result.
Declaration
[Unmanaged]
public static bool CompareValues(float a, float b, BehaviorValueComparison comparison)
Parameters
System.Single
a
The left operand. |
System.Single
b
The right operand. |
BehaviorValueComparison
comparison
The comparison function. |
Returns
System.Boolean
True if comparision passed, otherwise false. |
Get(String, out Object)
Gets the knowledge item value via selector path.
Declaration
[Unmanaged]
public bool Get(string path, out object value)
Parameters
System.String
path
Selector path. |
System.Object
value
Result value (valid only when returned true). |
Returns
System.Boolean
True if got value, otherwise false. |
See Also
GetGoal(Type)
Gets the goal from the knowledge.
Declaration
[Unmanaged]
public object GetGoal(Type type)
Parameters
System.Type
type
The goal type. |
Returns
System.Object
The goal value or null if not found. |
HasGoal(Type)
Checks if knowledge has a given goal (exact type match without base class check).
Declaration
[Unmanaged]
public bool HasGoal(Type type)
Parameters
System.Type
type
The goal type. |
Returns
System.Boolean
True if knowledge has a given goal, otherwise false. |
HasGoal<T>()
Checks if knowledge has a given goal (exact type match without base class check).
Declaration
[Unmanaged]
public bool HasGoal<T>()
Returns
System.Boolean
True if ahs a given goal, otherwise false. |
Type Parameters
T
goal type. |
RemoveGoal(Type)
Removes the goal from the knowledge. Does nothing if goal of the given type doesn't exist in the knowledge.
Declaration
[Unmanaged]
public void RemoveGoal(Type type)
Parameters
System.Type
type
The goal type. |
RemoveGoal<T>()
Removes the goal from the knowledge. Does nothing if goal of the given type doesn't exist in the knowledge.
Declaration
[Unmanaged]
public void RemoveGoal<T>()
Type Parameters
T
goal type. |
Set(String, Object)
Sets the knowledge item value via selector path.
Declaration
[Unmanaged]
public bool Set(string path, object value)
Parameters
System.String
path
Selector path. |
System.Object
value
Value to set. |
Returns
System.Boolean
True if set value, otherwise false. |