yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_registry.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_EDITOR_REGISTRY_H_
2#define YAZE_APP_EDITOR_SYSTEM_EDITOR_REGISTRY_H_
3
4#include <string>
5#include <unordered_map>
6#include <vector>
7
8#include "app/editor/editor.h"
9
10namespace yaze {
11namespace editor {
12
24 public:
25 EditorRegistry() = default;
26 ~EditorRegistry() = default;
27
28 // Editor type management (static methods for global access)
29 static bool IsCardBasedEditor(EditorType type);
30 static std::string GetEditorCategory(EditorType type);
31 static EditorType GetEditorTypeFromCategory(const std::string& category);
32
33 // Editor navigation
34 void JumpToDungeonRoom(int room_id);
35 void JumpToOverworldMap(int map_id);
36 void SwitchToEditor(EditorType editor_type);
37
38 // Editor card management
40 void ShowEditorCards(EditorType editor_type);
41 void ToggleEditorCards(EditorType editor_type);
42
43 // Editor information
44 std::vector<EditorType> GetEditorsInCategory(const std::string& category) const;
45 std::vector<std::string> GetAvailableCategories() const;
46 std::string GetEditorDisplayName(EditorType type) const;
47
48 // Editor lifecycle
49 void RegisterEditor(EditorType type, Editor* editor);
51 Editor* GetEditor(EditorType type) const;
52
53 // Editor state queries
54 bool IsEditorActive(EditorType type) const;
55 bool IsEditorVisible(EditorType type) const;
56 void SetEditorActive(EditorType type, bool active);
57
58 private:
59 // Editor type mappings
60 static const std::unordered_map<EditorType, std::string> kEditorCategories;
61 static const std::unordered_map<EditorType, std::string> kEditorNames;
62 static const std::unordered_map<EditorType, bool> kCardBasedEditors;
63
64 // Registered editors
65 std::unordered_map<EditorType, Editor*> registered_editors_;
66
67 // Helper methods
68 bool IsValidEditorType(EditorType type) const;
69 void ValidateEditorType(EditorType type) const;
70};
71
72} // namespace editor
73} // namespace yaze
74
75#endif // YAZE_APP_EDITOR_SYSTEM_EDITOR_REGISTRY_H_
Manages editor types, categories, and lifecycle.
void RegisterEditor(EditorType type, Editor *editor)
static const std::unordered_map< EditorType, std::string > kEditorNames
static EditorType GetEditorTypeFromCategory(const std::string &category)
static const std::unordered_map< EditorType, std::string > kEditorCategories
void ToggleEditorCards(EditorType editor_type)
void ValidateEditorType(EditorType type) const
std::vector< EditorType > GetEditorsInCategory(const std::string &category) const
void SetEditorActive(EditorType type, bool active)
std::string GetEditorDisplayName(EditorType type) const
void UnregisterEditor(EditorType type)
bool IsEditorActive(EditorType type) const
void JumpToOverworldMap(int map_id)
bool IsValidEditorType(EditorType type) const
static const std::unordered_map< EditorType, bool > kCardBasedEditors
bool IsEditorVisible(EditorType type) const
static bool IsCardBasedEditor(EditorType type)
void ShowEditorCards(EditorType editor_type)
void SwitchToEditor(EditorType editor_type)
std::vector< std::string > GetAvailableCategories() const
void JumpToDungeonRoom(int room_id)
Editor * GetEditor(EditorType type) const
static std::string GetEditorCategory(EditorType type)
std::unordered_map< EditorType, Editor * > registered_editors_
Interface for editor classes.
Definition editor.h:122
Main namespace for the application.
Definition controller.cc:20