![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton that owns all NodeGroup instances for the active graph. More...
#include <NodeGroup.h>
Public Member Functions | |
| int | CreateGroup (const std::string &name, const std::vector< int > &nodeIds) |
| Creates a new group from the given node IDs. | |
| void | DeleteGroup (int groupId) |
| Deletes the group with the given ID. | |
| void | CollapseGroup (int groupId) |
| Marks the group as collapsed. | |
| void | ExpandGroup (int groupId) |
| Marks the group as expanded. | |
| NodeGroup * | GetGroup (int groupId) |
| Returns a pointer to the group with the given ID. | |
| int | GetGroupCount () const |
| Returns the total number of groups. | |
| void | Clear () |
| Removes all groups and resets the ID counter. | |
| void | SaveToJson (nlohmann::json &j) const |
| void | LoadFromJson (const nlohmann::json &j) |
Static Public Member Functions | |
| static GroupManager & | Get () |
| Returns the single shared instance. | |
Private Member Functions | |
| GroupManager () | |
Private Attributes | |
| std::vector< NodeGroup > | m_Groups |
| int | m_NextGroupId |
Singleton that owns all NodeGroup instances for the active graph.
Typical usage:
Definition at line 64 of file NodeGroup.h.
|
private |
Definition at line 83 of file NodeGroup.cpp.
| void Olympe::GroupManager::Clear | ( | ) |
Removes all groups and resets the ID counter.
Definition at line 143 of file NodeGroup.cpp.
References m_Groups, and m_NextGroupId.
Referenced by LoadFromJson().
Here is the caller graph for this function:Marks the group as collapsed.
No-op if not found.
Definition at line 114 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), and GetGroup().
Here is the call graph for this function:| int Olympe::GroupManager::CreateGroup | ( | const std::string & | name, |
| const std::vector< int > & | nodeIds | ||
| ) |
Creates a new group from the given node IDs.
Definition at line 92 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), Olympe::NodeGroup::id, m_Groups, and m_NextGroupId.
Here is the call graph for this function:Deletes the group with the given ID.
No-op if not found.
Definition at line 102 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), and m_Groups.
Here is the call graph for this function:Marks the group as expanded.
No-op if not found.
Definition at line 121 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), and GetGroup().
Here is the call graph for this function:
|
static |
Returns the single shared instance.
Definition at line 77 of file NodeGroup.cpp.
Returns a pointer to the group with the given ID.
Definition at line 128 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), and m_Groups.
Referenced by CollapseGroup(), and ExpandGroup().
Here is the call graph for this function:
Here is the caller graph for this function:| int Olympe::GroupManager::GetGroupCount | ( | ) | const |
Returns the total number of groups.
Definition at line 138 of file NodeGroup.cpp.
References m_Groups.
| void Olympe::GroupManager::LoadFromJson | ( | const nlohmann::json & | j | ) |
Definition at line 161 of file NodeGroup.cpp.
References Clear(), Olympe::NodeGroup::FromJson(), GetComponentTypeID_Static(), m_Groups, and m_NextGroupId.
Here is the call graph for this function:| void Olympe::GroupManager::SaveToJson | ( | nlohmann::json & | j | ) | const |
Definition at line 153 of file NodeGroup.cpp.
References GetComponentTypeID_Static(), and m_Groups.
Here is the call graph for this function:
|
private |
Definition at line 116 of file NodeGroup.h.
Referenced by Clear(), CreateGroup(), DeleteGroup(), GetGroup(), GetGroupCount(), LoadFromJson(), and SaveToJson().
|
private |
Definition at line 117 of file NodeGroup.h.
Referenced by Clear(), CreateGroup(), and LoadFromJson().