Manages editor types, categories, and lifecycle. More...
#include <editor_registry.h>
Public Member Functions | |
EditorRegistry ()=default | |
~EditorRegistry ()=default | |
void | JumpToDungeonRoom (int room_id) |
void | JumpToOverworldMap (int map_id) |
void | SwitchToEditor (EditorType editor_type) |
void | HideCurrentEditorCards () |
void | ShowEditorCards (EditorType editor_type) |
void | ToggleEditorCards (EditorType editor_type) |
std::vector< EditorType > | GetEditorsInCategory (const std::string &category) const |
std::vector< std::string > | GetAvailableCategories () const |
std::string | GetEditorDisplayName (EditorType type) const |
void | RegisterEditor (EditorType type, Editor *editor) |
void | UnregisterEditor (EditorType type) |
Editor * | GetEditor (EditorType type) const |
bool | IsEditorActive (EditorType type) const |
bool | IsEditorVisible (EditorType type) const |
void | SetEditorActive (EditorType type, bool active) |
Static Public Member Functions | |
static bool | IsCardBasedEditor (EditorType type) |
static std::string | GetEditorCategory (EditorType type) |
static EditorType | GetEditorTypeFromCategory (const std::string &category) |
Private Member Functions | |
bool | IsValidEditorType (EditorType type) const |
void | ValidateEditorType (EditorType type) const |
Private Attributes | |
std::unordered_map< EditorType, Editor * > | registered_editors_ |
Static Private Attributes | |
static const std::unordered_map< EditorType, std::string > | kEditorCategories |
static const std::unordered_map< EditorType, std::string > | kEditorNames |
static const std::unordered_map< EditorType, bool > | kCardBasedEditors |
Manages editor types, categories, and lifecycle.
Extracted from EditorManager to provide focused editor management:
Definition at line 23 of file editor_registry.h.
|
default |
|
default |
|
static |
Definition at line 59 of file editor_registry.cc.
References kCardBasedEditors.
Referenced by yaze::editor::UICoordinator::DrawContextSensitiveCardControl(), HideCurrentEditorCards(), yaze::editor::EditorManager::IsCardBasedEditor(), ShowEditorCards(), and ToggleEditorCards().
|
static |
Definition at line 64 of file editor_registry.cc.
References kEditorCategories.
Referenced by yaze::editor::UICoordinator::DrawContextSensitiveCardControl(), yaze::editor::EditorManager::HideCurrentEditorCards(), yaze::editor::UICoordinator::HideCurrentEditorCards(), yaze::editor::EditorManager::SwitchToEditor(), and yaze::editor::EditorManager::Update().
|
static |
Definition at line 72 of file editor_registry.cc.
References kEditorCategories, and yaze::editor::kSettings.
Referenced by yaze::editor::EditorManager::Update().
void yaze::editor::EditorRegistry::JumpToDungeonRoom | ( | int | room_id | ) |
Definition at line 81 of file editor_registry.cc.
References yaze::editor::kDungeon, and registered_editors_.
void yaze::editor::EditorRegistry::JumpToOverworldMap | ( | int | map_id | ) |
Definition at line 90 of file editor_registry.cc.
References yaze::editor::kOverworld, and registered_editors_.
void yaze::editor::EditorRegistry::SwitchToEditor | ( | EditorType | editor_type | ) |
Definition at line 99 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().
void yaze::editor::EditorRegistry::HideCurrentEditorCards | ( | ) |
Definition at line 117 of file editor_registry.cc.
References GetEditorDisplayName(), IsCardBasedEditor(), and registered_editors_.
void yaze::editor::EditorRegistry::ShowEditorCards | ( | EditorType | editor_type | ) |
Definition at line 126 of file editor_registry.cc.
References GetEditorDisplayName(), IsCardBasedEditor(), and ValidateEditorType().
void yaze::editor::EditorRegistry::ToggleEditorCards | ( | EditorType | editor_type | ) |
Definition at line 135 of file editor_registry.cc.
References GetEditorDisplayName(), IsCardBasedEditor(), and ValidateEditorType().
std::vector< EditorType > yaze::editor::EditorRegistry::GetEditorsInCategory | ( | const std::string & | category | ) | const |
Definition at line 144 of file editor_registry.cc.
References kEditorCategories.
std::vector< std::string > yaze::editor::EditorRegistry::GetAvailableCategories | ( | ) | const |
Definition at line 156 of file editor_registry.cc.
References kEditorCategories.
std::string yaze::editor::EditorRegistry::GetEditorDisplayName | ( | EditorType | type | ) | const |
Definition at line 170 of file editor_registry.cc.
References kEditorNames.
Referenced by HideCurrentEditorCards(), RegisterEditor(), ShowEditorCards(), SwitchToEditor(), ToggleEditorCards(), and UnregisterEditor().
void yaze::editor::EditorRegistry::RegisterEditor | ( | EditorType | type, |
Editor * | editor | ||
) |
Definition at line 178 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().
void yaze::editor::EditorRegistry::UnregisterEditor | ( | EditorType | type | ) |
Definition at line 189 of file editor_registry.cc.
References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().
Editor * yaze::editor::EditorRegistry::GetEditor | ( | EditorType | type | ) | const |
Definition at line 199 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().
bool yaze::editor::EditorRegistry::IsEditorActive | ( | EditorType | type | ) | const |
Definition at line 209 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().
bool yaze::editor::EditorRegistry::IsEditorVisible | ( | EditorType | type | ) | const |
Definition at line 219 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().
void yaze::editor::EditorRegistry::SetEditorActive | ( | EditorType | type, |
bool | active | ||
) |
Definition at line 229 of file editor_registry.cc.
References registered_editors_, and ValidateEditorType().
|
private |
Definition at line 238 of file editor_registry.cc.
References kEditorCategories.
Referenced by ValidateEditorType().
|
private |
Definition at line 242 of file editor_registry.cc.
References IsValidEditorType().
Referenced by GetEditor(), IsEditorActive(), IsEditorVisible(), RegisterEditor(), SetEditorActive(), ShowEditorCards(), SwitchToEditor(), ToggleEditorCards(), and UnregisterEditor().
|
staticprivate |
Definition at line 60 of file editor_registry.h.
Referenced by GetAvailableCategories(), GetEditorCategory(), GetEditorsInCategory(), GetEditorTypeFromCategory(), and IsValidEditorType().
|
staticprivate |
Definition at line 61 of file editor_registry.h.
Referenced by GetEditorDisplayName().
|
staticprivate |
Definition at line 62 of file editor_registry.h.
Referenced by IsCardBasedEditor().
|
private |
Definition at line 65 of file editor_registry.h.
Referenced by GetEditor(), HideCurrentEditorCards(), IsEditorActive(), IsEditorVisible(), JumpToDungeonRoom(), JumpToOverworldMap(), RegisterEditor(), SetEditorActive(), SwitchToEditor(), and UnregisterEditor().