Project

group Project

Project management components of the CoffeeEngine.

class Project
#include <Project.h>

The Project class is responsible for managing project data such as name, directory, and start scene path.

Public Functions

template<class Archive>
inline void serialize(Archive &archive, std::uint32_t const version)

Serializes the project data.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Static Functions

static Ref<Project> New(const std::filesystem::path &path)

Creates a new project.

Returns:

A reference to the newly created project.

static Ref<Project> Load(const std::filesystem::path &path)

Loads a project from the specified path.

Parameters:

path – The path to the project file.

Returns:

A reference to the loaded project.

static void SaveActive()

Saves the active project to the specified path.

Parameters:

path – The path to save the project file.

static inline Ref<Project> GetActive()

Gets the active project.

Returns:

A reference to the active project.

static inline const std::filesystem::path &GetProjectDirectory()

Gets the directory of the active project.

Returns:

The path to the project directory.

static inline const std::string &GetProjectName()

Gets the name of the active project.

Returns:

The name of the project.

static inline std::filesystem::path GetCacheDirectory()

Retrieves the cache directory path of the active project.

This static method returns a constant reference to the cache directory path associated with the currently active project.

Returns:

const std::filesystem::path& Reference to the cache directory path.

static inline std::filesystem::path GetAudioDirectory()

Retrieves de audio directory path of the active project.

This static method returns a reference to the audio directory absolute path associated with the currently active project If no audio directory has been defined, it returns the project’s directory path instead

Returns:

audio directory absolute path

static inline std::filesystem::path GetRelativeAudioDirectory()

Retrieves the audio directory relative path of the active object.

This static method returns a reference to the audio directory relative path associated with the currently active project. If no audio directory has been defined, it returns an empty path instead

Returns:

The audio directory relative path

static inline void SetRelativeAudioDirectory(const std::filesystem::path &path)

Sets the project’s audio directory to the path specified.

Parameters:

path – The relative path to the audio directory