// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "Engine/Scripting/ScriptingObject.h" class Behavior; class BehaviorTree; /// /// Behavior logic component knowledge data container. Contains blackboard values, sensors data and goals storage for Behavior Tree execution. /// API_CLASS() class FLAXENGINE_API BehaviorKnowledge : public ScriptingObject { DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(BehaviorKnowledge, ScriptingObject); ~BehaviorKnowledge(); /// /// Owning Behavior instance (constant). /// API_FIELD(ReadOnly) Behavior* Behavior = nullptr; /// /// Used Behavior Tree asset (defines blackboard and memory constraints). /// API_FIELD(ReadOnly) BehaviorTree* Tree = nullptr; /// /// Raw memory chunk with all Behavior Tree nodes state. /// API_FIELD(ReadOnly) void* Memory = nullptr; /// /// Instance of the behaviour blackboard (structure or class). /// API_FIELD() Variant Blackboard; // TODO: sensors data // TODO: goals // TODO: GetGoal/HasGoal /// /// Initializes the knowledge for a certain tree. /// void InitMemory(BehaviorTree* tree); /// /// Releases the memory of the knowledge. /// void FreeMemory(); };