![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton that stores, serialises, and retrieves NodePreset instances. More...
#include <NodePresets.h>
Public Member Functions | |
| void | LoadPresets (const std::string &path) |
Loads presets from a JSON file at path. | |
| void | SavePresets (const std::string &path) const |
Saves all current presets to a JSON file at path. | |
| void | AddPreset (const NodePreset &preset) |
| Adds or replaces a preset (matched by name). | |
| void | RemovePreset (const std::string &name) |
| Removes the preset with the given name. | |
| NodePreset * | GetPreset (const std::string &name) |
| Returns a pointer to the preset with the given name. | |
| std::vector< NodePreset > | GetPresetsInCategory (const std::string &category) const |
Returns all presets that belong to category. | |
| int | GetPresetCount () const |
| Returns the total number of stored presets. | |
| void | Clear () |
| Removes all presets. | |
Static Public Member Functions | |
| static NodePresetManager & | Get () |
| Returns the single shared instance. | |
Private Member Functions | |
| NodePresetManager () | |
Private Attributes | |
| std::vector< NodePreset > | m_Presets |
Singleton that stores, serialises, and retrieves NodePreset instances.
Typical usage:
Definition at line 69 of file NodePresets.h.
|
private |
Definition at line 77 of file NodePresets.cpp.
| void Olympe::NodePresetManager::AddPreset | ( | const NodePreset & | preset | ) |
Adds or replaces a preset (matched by name).
Definition at line 149 of file NodePresets.cpp.
References GetComponentTypeID_Static(), and m_Presets.
Here is the call graph for this function:| void Olympe::NodePresetManager::Clear | ( | ) |
Removes all presets.
Definition at line 202 of file NodePresets.cpp.
References m_Presets.
Referenced by LoadPresets().
Here is the caller graph for this function:
|
static |
Returns the single shared instance.
Definition at line 71 of file NodePresets.cpp.
| NodePreset * Olympe::NodePresetManager::GetPreset | ( | const std::string & | name | ) |
Returns a pointer to the preset with the given name.
Definition at line 175 of file NodePresets.cpp.
References GetComponentTypeID_Static(), and m_Presets.
Here is the call graph for this function:| int Olympe::NodePresetManager::GetPresetCount | ( | ) | const |
Returns the total number of stored presets.
Definition at line 197 of file NodePresets.cpp.
References m_Presets.
| std::vector< NodePreset > Olympe::NodePresetManager::GetPresetsInCategory | ( | const std::string & | category | ) | const |
Returns all presets that belong to category.
Definition at line 185 of file NodePresets.cpp.
References GetComponentTypeID_Static(), and m_Presets.
Here is the call graph for this function:Loads presets from a JSON file at path.
Existing presets are replaced.
Definition at line 85 of file NodePresets.cpp.
References Clear(), Olympe::NodePreset::FromJson(), GetComponentTypeID_Static(), m_Presets, and SYSTEM_LOG.
Here is the call graph for this function:Removes the preset with the given name.
No-op if not found.
Definition at line 163 of file NodePresets.cpp.
References GetComponentTypeID_Static(), and m_Presets.
Here is the call graph for this function:Saves all current presets to a JSON file at path.
Definition at line 124 of file NodePresets.cpp.
References GetComponentTypeID_Static(), m_Presets, and SYSTEM_LOG.
Here is the call graph for this function:
|
private |
Definition at line 125 of file NodePresets.h.
Referenced by AddPreset(), Clear(), GetPreset(), GetPresetCount(), GetPresetsInCategory(), LoadPresets(), RemovePreset(), and SavePresets().