![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Singleton that owns all GraphComment instances for the active graph. More...
#include <GraphComment.h>
Public Member Functions | |
| int | AddComment (const GraphComment &comment) |
| Adds a comment and assigns it a unique ID. | |
| void | RemoveComment (int commentId) |
| Removes the comment with the given ID. | |
| GraphComment * | GetComment (int commentId) |
| Returns a pointer to the comment with the given ID. | |
| void | UpdateComment (int commentId, const GraphComment &comment) |
| Replaces the stored comment data for the given ID. | |
| int | GetCommentCount () const |
| Returns the total number of comments managed. | |
| void | Clear () |
| Removes all comments and resets the ID counter. | |
| void | SaveToJson (nlohmann::json &j) const |
| void | LoadFromJson (const nlohmann::json &j) |
Static Public Member Functions | |
| static CommentManager & | Get () |
| Returns the single shared instance. | |
Private Member Functions | |
| CommentManager () | |
Private Attributes | |
| std::vector< GraphComment > | m_Comments |
| int | m_NextCommentId |
Singleton that owns all GraphComment instances for the active graph.
Typical usage:
Definition at line 67 of file GraphComment.h.
|
private |
Definition at line 79 of file GraphComment.cpp.
| int Olympe::CommentManager::AddComment | ( | const GraphComment & | comment | ) |
Adds a comment and assigns it a unique ID.
Definition at line 88 of file GraphComment.cpp.
References GetComponentTypeID_Static(), Olympe::GraphComment::id, m_Comments, and m_NextCommentId.
Here is the call graph for this function:| void Olympe::CommentManager::Clear | ( | ) |
Removes all comments and resets the ID counter.
Definition at line 139 of file GraphComment.cpp.
References m_Comments, and m_NextCommentId.
Referenced by LoadFromJson().
Here is the caller graph for this function:
|
static |
Returns the single shared instance.
Definition at line 73 of file GraphComment.cpp.
| GraphComment * Olympe::CommentManager::GetComment | ( | int | commentId | ) |
Returns a pointer to the comment with the given ID.
Definition at line 108 of file GraphComment.cpp.
References GetComponentTypeID_Static(), and m_Comments.
Here is the call graph for this function:| int Olympe::CommentManager::GetCommentCount | ( | ) | const |
Returns the total number of comments managed.
Definition at line 134 of file GraphComment.cpp.
References m_Comments.
| void Olympe::CommentManager::LoadFromJson | ( | const nlohmann::json & | j | ) |
Definition at line 157 of file GraphComment.cpp.
References Clear(), Olympe::GraphComment::FromJson(), GetComponentTypeID_Static(), m_Comments, and m_NextCommentId.
Here is the call graph for this function:Removes the comment with the given ID.
No-op if not found.
Definition at line 96 of file GraphComment.cpp.
References GetComponentTypeID_Static(), and m_Comments.
Here is the call graph for this function:| void Olympe::CommentManager::SaveToJson | ( | nlohmann::json & | j | ) | const |
Definition at line 149 of file GraphComment.cpp.
References GetComponentTypeID_Static(), and m_Comments.
Here is the call graph for this function:| void Olympe::CommentManager::UpdateComment | ( | int | commentId, |
| const GraphComment & | comment | ||
| ) |
Replaces the stored comment data for the given ID.
Definition at line 118 of file GraphComment.cpp.
References GetComponentTypeID_Static(), Olympe::GraphComment::id, m_Comments, and SYSTEM_LOG.
Here is the call graph for this function:
|
private |
Definition at line 116 of file GraphComment.h.
Referenced by AddComment(), Clear(), GetComment(), GetCommentCount(), LoadFromJson(), RemoveComment(), SaveToJson(), and UpdateComment().
|
private |
Definition at line 117 of file GraphComment.h.
Referenced by AddComment(), Clear(), and LoadFromJson().