My Project
Loading...
Searching...
No Matches
Editor::ProjectManager Class Reference

Class responsible for managing editor projects. Handles project creation, loading, saving, and scene serialization within a project directory. More...

#include <ProjectManager.hpp>

Public Member Functions

 ~ProjectManager ()
 Destructor.
void createProject (const std::string &name, std::shared_ptr< Engine::Scene > &scene)
 Creates a new project with the specified name and initializes its scene.
void loadProject (const std::filesystem::path &path, std::shared_ptr< Engine::Scene > &scene)
 Loads a project and all resources contained within it.
void SetLastProject (const std::string &name)
 Stores the name of the last opened project.
void clearLastProject ()
 Clears the stored last project information.
void saveProject (std::shared_ptr< Engine::Scene > &scenes)
 Saves the current project and all associated scenes.
void saveScene (const Engine::Scene &scene, const std::filesystem::path &scenePath)
 Saves a specific scene to a file.
void SetProjectPath (const std::filesystem::path &path)
 Sets the current project path.
void SetLoadedProjectName (const std::string &name)
 Sets the name of the loaded project.
const std::filesystem::path & GetProjectPath () const
 Returns the current project path.
std::string GetLoadedProjectName () const
 Returns the name of the currently loaded project.

Static Public Member Functions

static ProjectManagerGet ()
 Returns the singleton instance of the ProjectManager.

Protected Member Functions

void loadScene (const std::filesystem::path &path, std::shared_ptr< Engine::Scene > &scene)
 Loads a scene from a file path and populates the provided scene object.

Protected Attributes

std::filesystem::path currentProjectPath
 Path to the currently opened project.

Detailed Description

Class responsible for managing editor projects. Handles project creation, loading, saving, and scene serialization within a project directory.

Constructor & Destructor Documentation

◆ ~ProjectManager()

Editor::ProjectManager::~ProjectManager ( )

Destructor.

Member Function Documentation

◆ clearLastProject()

void Editor::ProjectManager::clearLastProject ( )

Clears the stored last project information.

◆ createProject()

void Editor::ProjectManager::createProject ( const std::string & name,
std::shared_ptr< Engine::Scene > & scene )

Creates a new project with the specified name and initializes its scene.

Parameters
nameName of the project
sceneScene associated with the new project

◆ Get()

ProjectManager & Editor::ProjectManager::Get ( )
static

Returns the singleton instance of the ProjectManager.

Returns
Reference to the ProjectManager instance

◆ GetLoadedProjectName()

std::string Editor::ProjectManager::GetLoadedProjectName ( ) const
inline

Returns the name of the currently loaded project.

Returns
Project name

◆ GetProjectPath()

const std::filesystem::path & Editor::ProjectManager::GetProjectPath ( ) const

Returns the current project path.

Returns
Path to the loaded project

◆ loadProject()

void Editor::ProjectManager::loadProject ( const std::filesystem::path & path,
std::shared_ptr< Engine::Scene > & scene )

Loads a project and all resources contained within it.

Parameters
pathPath to the project directory
sceneScene that will receive the loaded data

◆ loadScene()

void Editor::ProjectManager::loadScene ( const std::filesystem::path & path,
std::shared_ptr< Engine::Scene > & scene )
protected

Loads a scene from a file path and populates the provided scene object.

Parameters
pathPath to the scene file
sceneScene instance to load data into

◆ saveProject()

void Editor::ProjectManager::saveProject ( std::shared_ptr< Engine::Scene > & scenes)

Saves the current project and all associated scenes.

Parameters
scenesScene to save

◆ saveScene()

void Editor::ProjectManager::saveScene ( const Engine::Scene & scene,
const std::filesystem::path & scenePath )

Saves a specific scene to a file.

Parameters
sceneScene to serialize
scenePathDestination file path

◆ SetLastProject()

void Editor::ProjectManager::SetLastProject ( const std::string & name)

Stores the name of the last opened project.

Parameters
nameProject name

◆ SetLoadedProjectName()

void Editor::ProjectManager::SetLoadedProjectName ( const std::string & name)
inline

Sets the name of the loaded project.

Parameters
nameProject name

◆ SetProjectPath()

void Editor::ProjectManager::SetProjectPath ( const std::filesystem::path & path)
inline

Sets the current project path.

Parameters
pathProject directory path

Member Data Documentation

◆ currentProjectPath

std::filesystem::path Editor::ProjectManager::currentProjectPath
protected

Path to the currently opened project.


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