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

Manages BehaviorTree projects. More...

#include <ProjectManager.h>

Public Member Functions

 ProjectManager (const ProjectManager &)=delete
ProjectManageroperator= (const ProjectManager &)=delete
std::shared_ptr< BehaviorTreeProjectCreateProject (const String &name, const String &description="")
bool OpenProject (const String &filepath)
bool SaveProject ()
bool SaveProjectAs (const String &filepath)
bool CloseProject ()
std::shared_ptr< BehaviorTreeProjectGetActiveProject () const
bool HasActiveProject () const
String GetActiveProjectPath () const
bool IsProjectModified () const
void SetProjectModified (bool modified)
const std::vector< String > & GetRecentProjects () const
void AddToRecentProjects (const String &filepath)
void RemoveFromRecentProjects (const String &filepath)
void ClearRecentProjects ()
bool RecentProjectExists (const String &filepath) const
String GetProjectsDirectory () const
bool EnsureProjectsDirectoryExists ()
void ResetToDefaults ()
bool LoadConfig ()
bool SaveConfig ()

Static Public Member Functions

static ProjectManagerGetInstance ()

Static Public Attributes

static const size_t MAX_RECENT_PROJECTS = 10

Private Member Functions

 ProjectManager ()
 ~ProjectManager ()=default
void AddToRecentProjectsInternal (const String &filepath)
void RemoveFromRecentProjectsInternal (const String &filepath)

Private Attributes

std::mutex mutex_
std::shared_ptr< BehaviorTreeProjectactive_project_
String active_project_path_
bool project_modified_
std::vector< Stringrecent_projects_
String projects_directory_
String config_file_

Detailed Description

Manages BehaviorTree projects.

This singleton class handles loading, saving, and managing BehaviorTree projects. It tracks the active project and maintains a list of recently opened projects.

Definition at line 17 of file ProjectManager.h.

Constructor & Destructor Documentation

◆ ProjectManager() [1/2]

EmberCore::ProjectManager::ProjectManager ( const ProjectManager & )
delete

◆ ProjectManager() [2/2]

EmberCore::ProjectManager::ProjectManager ( )
private

Definition at line 18 of file ProjectManager.cpp.

◆ ~ProjectManager()

EmberCore::ProjectManager::~ProjectManager ( )
privatedefault

Member Function Documentation

◆ AddToRecentProjects()

void EmberCore::ProjectManager::AddToRecentProjects ( const String & filepath)

Definition at line 212 of file ProjectManager.cpp.

◆ AddToRecentProjectsInternal()

void EmberCore::ProjectManager::AddToRecentProjectsInternal ( const String & filepath)
private

Definition at line 218 of file ProjectManager.cpp.

◆ ClearRecentProjects()

void EmberCore::ProjectManager::ClearRecentProjects ( )

Definition at line 244 of file ProjectManager.cpp.

◆ CloseProject()

bool EmberCore::ProjectManager::CloseProject ( )

Definition at line 164 of file ProjectManager.cpp.

◆ CreateProject()

std::shared_ptr< BehaviorTreeProject > EmberCore::ProjectManager::CreateProject ( const String & name,
const String & description = "" )

Definition at line 72 of file ProjectManager.cpp.

◆ EnsureProjectsDirectoryExists()

bool EmberCore::ProjectManager::EnsureProjectsDirectoryExists ( )

Definition at line 48 of file ProjectManager.cpp.

◆ GetActiveProject()

std::shared_ptr< BehaviorTreeProject > EmberCore::ProjectManager::GetActiveProject ( ) const

Definition at line 181 of file ProjectManager.cpp.

◆ GetActiveProjectPath()

String EmberCore::ProjectManager::GetActiveProjectPath ( ) const

Definition at line 191 of file ProjectManager.cpp.

◆ GetInstance()

ProjectManager & EmberCore::ProjectManager::GetInstance ( )
static

Definition at line 13 of file ProjectManager.cpp.

◆ GetProjectsDirectory()

String EmberCore::ProjectManager::GetProjectsDirectory ( ) const
inline

Definition at line 55 of file ProjectManager.h.

◆ GetRecentProjects()

const std::vector< String > & EmberCore::ProjectManager::GetRecentProjects ( ) const

Definition at line 206 of file ProjectManager.cpp.

◆ HasActiveProject()

bool EmberCore::ProjectManager::HasActiveProject ( ) const

Definition at line 186 of file ProjectManager.cpp.

◆ IsProjectModified()

bool EmberCore::ProjectManager::IsProjectModified ( ) const

Definition at line 196 of file ProjectManager.cpp.

◆ LoadConfig()

bool EmberCore::ProjectManager::LoadConfig ( )

Definition at line 268 of file ProjectManager.cpp.

◆ OpenProject()

bool EmberCore::ProjectManager::OpenProject ( const String & filepath)

Definition at line 81 of file ProjectManager.cpp.

◆ operator=()

ProjectManager & EmberCore::ProjectManager::operator= ( const ProjectManager & )
delete

◆ RecentProjectExists()

bool EmberCore::ProjectManager::RecentProjectExists ( const String & filepath) const

Definition at line 250 of file ProjectManager.cpp.

◆ RemoveFromRecentProjects()

void EmberCore::ProjectManager::RemoveFromRecentProjects ( const String & filepath)

Definition at line 231 of file ProjectManager.cpp.

◆ RemoveFromRecentProjectsInternal()

void EmberCore::ProjectManager::RemoveFromRecentProjectsInternal ( const String & filepath)
private

Definition at line 237 of file ProjectManager.cpp.

◆ ResetToDefaults()

void EmberCore::ProjectManager::ResetToDefaults ( )

Definition at line 255 of file ProjectManager.cpp.

◆ SaveConfig()

bool EmberCore::ProjectManager::SaveConfig ( )

Definition at line 305 of file ProjectManager.cpp.

◆ SaveProject()

bool EmberCore::ProjectManager::SaveProject ( )

Definition at line 117 of file ProjectManager.cpp.

◆ SaveProjectAs()

bool EmberCore::ProjectManager::SaveProjectAs ( const String & filepath)

Definition at line 140 of file ProjectManager.cpp.

◆ SetProjectModified()

void EmberCore::ProjectManager::SetProjectModified ( bool modified)

Definition at line 201 of file ProjectManager.cpp.

Member Data Documentation

◆ active_project_

std::shared_ptr<BehaviorTreeProject> EmberCore::ProjectManager::active_project_
private

Definition at line 77 of file ProjectManager.h.

◆ active_project_path_

String EmberCore::ProjectManager::active_project_path_
private

Definition at line 78 of file ProjectManager.h.

◆ config_file_

String EmberCore::ProjectManager::config_file_
private

Definition at line 83 of file ProjectManager.h.

◆ MAX_RECENT_PROJECTS

const size_t EmberCore::ProjectManager::MAX_RECENT_PROJECTS = 10
static

Definition at line 20 of file ProjectManager.h.

◆ mutex_

std::mutex EmberCore::ProjectManager::mutex_
mutableprivate

Definition at line 74 of file ProjectManager.h.

◆ project_modified_

bool EmberCore::ProjectManager::project_modified_
private

Definition at line 79 of file ProjectManager.h.

◆ projects_directory_

String EmberCore::ProjectManager::projects_directory_
private

Definition at line 82 of file ProjectManager.h.

◆ recent_projects_

std::vector<String> EmberCore::ProjectManager::recent_projects_
private

Definition at line 81 of file ProjectManager.h.


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