Search Results for

    Show / Hide Table of Contents

    Class BehaviorKnowledge

    Behavior logic component knowledge data container. Contains blackboard values, sensors data and goals storage for Behavior Tree execution.

    Inheritance
    Object
    ScriptingObject
    BehaviorKnowledge
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    ScriptingObject::SetManagedInstance(MObject* instance)
    BehaviorKnowledge
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    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.

    See Also
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat