3#include "absl/strings/str_format.h"
5#include <unordered_set>
74 if (cat == category) {
86 printf(
"[EditorRegistry] Jumping to dungeon room %d\n", room_id);
95 printf(
"[EditorRegistry] Jumping to overworld map %d\n", map_id);
106 if (type != editor_type && editor) {
107 editor->set_active(
false);
112 it->second->set_active(
true);
145 std::vector<EditorType> editors;
148 if (cat == category) {
149 editors.push_back(type);
157 std::vector<std::string> categories;
158 std::unordered_set<std::string> seen;
161 if (seen.find(category) == seen.end()) {
162 categories.push_back(category);
163 seen.insert(category);
175 return "Unknown Editor";
182 throw std::invalid_argument(
"Editor pointer cannot be null");
214 return it->second->active();
224 return it->second->active();
234 it->second->set_active(active);
244 throw std::invalid_argument(
245 absl::StrFormat(
"Invalid editor type: %d",
static_cast<int>(type)));
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 HideCurrentEditorCards()
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.
Main namespace for the application.