Ember
Loading...
Searching...
No Matches
EmberCore::BehaviorTreeProject Class Reference

Represents a BehaviorTree project containing multiple XML resources. More...

#include <BehaviorTreeProject.h>

Public Member Functions

 BehaviorTreeProject ()
 BehaviorTreeProject (const String &name, const String &description="")
 ~BehaviorTreeProject ()=default
String GetName () const
void SetName (const String &name)
String GetDescription () const
void SetDescription (const String &description)
String GetVersion () const
void SetVersion (const String &version)
int64_t GetCreatedTimestamp () const
int64_t GetModifiedTimestamp () const
void UpdateModifiedTimestamp ()
String GetParserProfileName () const
void SetParserProfileName (const String &profile_name)
bool AddResource (const String &filepath)
bool RemoveResource (const String &filepath)
bool HasResource (const String &filepath) const
void ClearResources ()
const std::vector< String > & GetResources () const
size_t GetResourceCount () const
String GetProjectFilePath () const
void SetProjectFilePath (const String &filepath)
String GetBaseDirectory () const
String ResolveResourcePath (const String &resource_path) const
String MakeRelativePath (const String &absolute_path) const
ProjectValidationReport ValidateResources () const
ProjectValidationReport ValidateWithParser (class LibXMLBehaviorTreeParser *parser) const
bool IsValid () const
void SetTreeImplementationStatus (const std::map< String, TreeImplementationStatus > &statuses)
const std::map< String, TreeImplementationStatus > & GetTreeImplementationStatuses () const
std::vector< StringGetUnimplementedReferences () const
std::vector< StringGetImplementedTrees () const
bool IsTreeImplemented (const String &tree_id) const
nlohmann::json ToJson () const
void FromJson (const nlohmann::json &json)
bool SaveToFile (const String &filepath)
bool LoadFromFile (const String &filepath)
std::shared_ptr< BehaviorTreeProjectClone (const String &new_name="") const

Static Public Member Functions

static std::shared_ptr< BehaviorTreeProjectCreateEmpty (const String &name)

Private Member Functions

ResourceValidationStatus ValidateSingleResource (const String &filepath) const

Static Private Member Functions

static int64_t GetCurrentTimestamp ()

Private Attributes

String name_
String description_
String version_
int64_t created_timestamp_
int64_t modified_timestamp_
String parser_profile_name_
 Name of the parser profile to use.
String project_filepath_
 Path to the project file itself.
std::vector< Stringresources_
 List of XML file paths (relative to project file)
std::map< String, TreeImplementationStatustree_statuses_

Detailed Description

Represents a BehaviorTree project containing multiple XML resources.

A project groups together multiple XML files that may reference each other's trees via SubTree nodes. It provides validation, resource management, and tracking of tree implementation status across all files.

Definition at line 78 of file BehaviorTreeProject.h.

Constructor & Destructor Documentation

◆ BehaviorTreeProject() [1/2]

EmberCore::BehaviorTreeProject::BehaviorTreeProject ( )

Definition at line 119 of file BehaviorTreeProject.cpp.

◆ BehaviorTreeProject() [2/2]

EmberCore::BehaviorTreeProject::BehaviorTreeProject ( const String & name,
const String & description = "" )
explicit

Definition at line 123 of file BehaviorTreeProject.cpp.

◆ ~BehaviorTreeProject()

EmberCore::BehaviorTreeProject::~BehaviorTreeProject ( )
default

Member Function Documentation

◆ AddResource()

bool EmberCore::BehaviorTreeProject::AddResource ( const String & filepath)

Definition at line 144 of file BehaviorTreeProject.cpp.

◆ ClearResources()

void EmberCore::BehaviorTreeProject::ClearResources ( )

Definition at line 174 of file BehaviorTreeProject.cpp.

◆ Clone()

std::shared_ptr< BehaviorTreeProject > EmberCore::BehaviorTreeProject::Clone ( const String & new_name = "") const

Definition at line 859 of file BehaviorTreeProject.cpp.

◆ CreateEmpty()

std::shared_ptr< BehaviorTreeProject > EmberCore::BehaviorTreeProject::CreateEmpty ( const String & name)
static

Definition at line 877 of file BehaviorTreeProject.cpp.

◆ FromJson()

void EmberCore::BehaviorTreeProject::FromJson ( const nlohmann::json & json)

Definition at line 759 of file BehaviorTreeProject.cpp.

◆ GetBaseDirectory()

String EmberCore::BehaviorTreeProject::GetBaseDirectory ( ) const

Definition at line 180 of file BehaviorTreeProject.cpp.

◆ GetCreatedTimestamp()

int64_t EmberCore::BehaviorTreeProject::GetCreatedTimestamp ( ) const
inline

Definition at line 94 of file BehaviorTreeProject.h.

◆ GetCurrentTimestamp()

int64_t EmberCore::BehaviorTreeProject::GetCurrentTimestamp ( )
staticprivate

Definition at line 881 of file BehaviorTreeProject.cpp.

◆ GetDescription()

String EmberCore::BehaviorTreeProject::GetDescription ( ) const
inline

Definition at line 88 of file BehaviorTreeProject.h.

◆ GetImplementedTrees()

std::vector< String > EmberCore::BehaviorTreeProject::GetImplementedTrees ( ) const

Definition at line 713 of file BehaviorTreeProject.cpp.

◆ GetModifiedTimestamp()

int64_t EmberCore::BehaviorTreeProject::GetModifiedTimestamp ( ) const
inline

Definition at line 95 of file BehaviorTreeProject.h.

◆ GetName()

String EmberCore::BehaviorTreeProject::GetName ( ) const
inline

Definition at line 85 of file BehaviorTreeProject.h.

◆ GetParserProfileName()

String EmberCore::BehaviorTreeProject::GetParserProfileName ( ) const
inline

Definition at line 99 of file BehaviorTreeProject.h.

◆ GetProjectFilePath()

String EmberCore::BehaviorTreeProject::GetProjectFilePath ( ) const
inline

Definition at line 111 of file BehaviorTreeProject.h.

◆ GetResourceCount()

size_t EmberCore::BehaviorTreeProject::GetResourceCount ( ) const
inline

Definition at line 108 of file BehaviorTreeProject.h.

◆ GetResources()

const std::vector< String > & EmberCore::BehaviorTreeProject::GetResources ( ) const
inline

Definition at line 107 of file BehaviorTreeProject.h.

◆ GetTreeImplementationStatuses()

const std::map< String, TreeImplementationStatus > & EmberCore::BehaviorTreeProject::GetTreeImplementationStatuses ( ) const
inline

Definition at line 130 of file BehaviorTreeProject.h.

◆ GetUnimplementedReferences()

std::vector< String > EmberCore::BehaviorTreeProject::GetUnimplementedReferences ( ) const

Definition at line 702 of file BehaviorTreeProject.cpp.

◆ GetVersion()

String EmberCore::BehaviorTreeProject::GetVersion ( ) const
inline

Definition at line 91 of file BehaviorTreeProject.h.

◆ HasResource()

bool EmberCore::BehaviorTreeProject::HasResource ( const String & filepath) const

Definition at line 170 of file BehaviorTreeProject.cpp.

◆ IsTreeImplemented()

bool EmberCore::BehaviorTreeProject::IsTreeImplemented ( const String & tree_id) const

Definition at line 723 of file BehaviorTreeProject.cpp.

◆ IsValid()

bool EmberCore::BehaviorTreeProject::IsValid ( ) const

Definition at line 580 of file BehaviorTreeProject.cpp.

◆ LoadFromFile()

bool EmberCore::BehaviorTreeProject::LoadFromFile ( const String & filepath)

Definition at line 835 of file BehaviorTreeProject.cpp.

◆ MakeRelativePath()

String EmberCore::BehaviorTreeProject::MakeRelativePath ( const String & absolute_path) const

Definition at line 216 of file BehaviorTreeProject.cpp.

◆ RemoveResource()

bool EmberCore::BehaviorTreeProject::RemoveResource ( const String & filepath)

Definition at line 157 of file BehaviorTreeProject.cpp.

◆ ResolveResourcePath()

String EmberCore::BehaviorTreeProject::ResolveResourcePath ( const String & resource_path) const

Definition at line 200 of file BehaviorTreeProject.cpp.

◆ SaveToFile()

bool EmberCore::BehaviorTreeProject::SaveToFile ( const String & filepath)

Definition at line 811 of file BehaviorTreeProject.cpp.

◆ SetDescription()

void EmberCore::BehaviorTreeProject::SetDescription ( const String & description)

Definition at line 132 of file BehaviorTreeProject.cpp.

◆ SetName()

void EmberCore::BehaviorTreeProject::SetName ( const String & name)

Definition at line 127 of file BehaviorTreeProject.cpp.

◆ SetParserProfileName()

void EmberCore::BehaviorTreeProject::SetParserProfileName ( const String & profile_name)

Definition at line 139 of file BehaviorTreeProject.cpp.

◆ SetProjectFilePath()

void EmberCore::BehaviorTreeProject::SetProjectFilePath ( const String & filepath)
inline

Definition at line 112 of file BehaviorTreeProject.h.

◆ SetTreeImplementationStatus()

void EmberCore::BehaviorTreeProject::SetTreeImplementationStatus ( const std::map< String, TreeImplementationStatus > & statuses)

Definition at line 698 of file BehaviorTreeProject.cpp.

◆ SetVersion()

void EmberCore::BehaviorTreeProject::SetVersion ( const String & version)
inline

Definition at line 92 of file BehaviorTreeProject.h.

◆ ToJson()

nlohmann::json EmberCore::BehaviorTreeProject::ToJson ( ) const

Definition at line 731 of file BehaviorTreeProject.cpp.

◆ UpdateModifiedTimestamp()

void EmberCore::BehaviorTreeProject::UpdateModifiedTimestamp ( )

Definition at line 137 of file BehaviorTreeProject.cpp.

◆ ValidateResources()

ProjectValidationReport EmberCore::BehaviorTreeProject::ValidateResources ( ) const

Definition at line 430 of file BehaviorTreeProject.cpp.

◆ ValidateSingleResource()

ResourceValidationStatus EmberCore::BehaviorTreeProject::ValidateSingleResource ( const String & filepath) const
private

Definition at line 265 of file BehaviorTreeProject.cpp.

◆ ValidateWithParser()

ProjectValidationReport EmberCore::BehaviorTreeProject::ValidateWithParser ( class LibXMLBehaviorTreeParser * parser) const

Definition at line 585 of file BehaviorTreeProject.cpp.

Member Data Documentation

◆ created_timestamp_

int64_t EmberCore::BehaviorTreeProject::created_timestamp_
private

Definition at line 160 of file BehaviorTreeProject.h.

◆ description_

String EmberCore::BehaviorTreeProject::description_
private

Definition at line 158 of file BehaviorTreeProject.h.

◆ modified_timestamp_

int64_t EmberCore::BehaviorTreeProject::modified_timestamp_
private

Definition at line 161 of file BehaviorTreeProject.h.

◆ name_

String EmberCore::BehaviorTreeProject::name_
private

Definition at line 157 of file BehaviorTreeProject.h.

◆ parser_profile_name_

String EmberCore::BehaviorTreeProject::parser_profile_name_
private

Name of the parser profile to use.

Definition at line 163 of file BehaviorTreeProject.h.

◆ project_filepath_

String EmberCore::BehaviorTreeProject::project_filepath_
private

Path to the project file itself.

Definition at line 164 of file BehaviorTreeProject.h.

◆ resources_

std::vector<String> EmberCore::BehaviorTreeProject::resources_
private

List of XML file paths (relative to project file)

Definition at line 166 of file BehaviorTreeProject.h.

◆ tree_statuses_

std::map<String, TreeImplementationStatus> EmberCore::BehaviorTreeProject::tree_statuses_
private

Definition at line 169 of file BehaviorTreeProject.h.

◆ version_

String EmberCore::BehaviorTreeProject::version_
private

Definition at line 159 of file BehaviorTreeProject.h.


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