yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::EditorRegistry Class Reference

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< EditorTypeGetEditorsInCategory (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)
 
EditorGetEditor (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
 

Detailed Description

Manages editor types, categories, and lifecycle.

Extracted from EditorManager to provide focused editor management:

  • Editor type classification and categorization
  • Editor activation and switching
  • Editor-specific navigation (jump to room/map)
  • Editor card management

Definition at line 23 of file editor_registry.h.

Constructor & Destructor Documentation

◆ EditorRegistry()

yaze::editor::EditorRegistry::EditorRegistry ( )
default

◆ ~EditorRegistry()

yaze::editor::EditorRegistry::~EditorRegistry ( )
default

Member Function Documentation

◆ IsCardBasedEditor()

◆ GetEditorCategory()

◆ GetEditorTypeFromCategory()

EditorType yaze::editor::EditorRegistry::GetEditorTypeFromCategory ( const std::string &  category)
static

Definition at line 72 of file editor_registry.cc.

References kEditorCategories, and yaze::editor::kSettings.

Referenced by yaze::editor::EditorManager::Update().

◆ JumpToDungeonRoom()

void yaze::editor::EditorRegistry::JumpToDungeonRoom ( int  room_id)
Todo:
Implement dungeon room jumping

Definition at line 81 of file editor_registry.cc.

References yaze::editor::kDungeon, and registered_editors_.

◆ JumpToOverworldMap()

void yaze::editor::EditorRegistry::JumpToOverworldMap ( int  map_id)
Todo:
Implement overworld map jumping

Definition at line 90 of file editor_registry.cc.

References yaze::editor::kOverworld, and registered_editors_.

◆ SwitchToEditor()

void yaze::editor::EditorRegistry::SwitchToEditor ( EditorType  editor_type)

Definition at line 99 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ HideCurrentEditorCards()

void yaze::editor::EditorRegistry::HideCurrentEditorCards ( )
Todo:
Hide cards for this editor

Definition at line 117 of file editor_registry.cc.

References GetEditorDisplayName(), IsCardBasedEditor(), and registered_editors_.

Here is the call graph for this function:

◆ ShowEditorCards()

void yaze::editor::EditorRegistry::ShowEditorCards ( EditorType  editor_type)
Todo:
Show cards for this editor

Definition at line 126 of file editor_registry.cc.

References GetEditorDisplayName(), IsCardBasedEditor(), and ValidateEditorType().

Here is the call graph for this function:

◆ ToggleEditorCards()

void yaze::editor::EditorRegistry::ToggleEditorCards ( EditorType  editor_type)
Todo:
Toggle cards for this editor

Definition at line 135 of file editor_registry.cc.

References GetEditorDisplayName(), IsCardBasedEditor(), and ValidateEditorType().

Here is the call graph for this function:

◆ GetEditorsInCategory()

std::vector< EditorType > yaze::editor::EditorRegistry::GetEditorsInCategory ( const std::string &  category) const

Definition at line 144 of file editor_registry.cc.

References kEditorCategories.

◆ GetAvailableCategories()

std::vector< std::string > yaze::editor::EditorRegistry::GetAvailableCategories ( ) const

Definition at line 156 of file editor_registry.cc.

References kEditorCategories.

◆ GetEditorDisplayName()

std::string yaze::editor::EditorRegistry::GetEditorDisplayName ( EditorType  type) const

◆ RegisterEditor()

void yaze::editor::EditorRegistry::RegisterEditor ( EditorType  type,
Editor editor 
)

Definition at line 178 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ UnregisterEditor()

void yaze::editor::EditorRegistry::UnregisterEditor ( EditorType  type)

Definition at line 189 of file editor_registry.cc.

References GetEditorDisplayName(), registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ GetEditor()

Editor * yaze::editor::EditorRegistry::GetEditor ( EditorType  type) const

Definition at line 199 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsEditorActive()

bool yaze::editor::EditorRegistry::IsEditorActive ( EditorType  type) const

Definition at line 209 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsEditorVisible()

bool yaze::editor::EditorRegistry::IsEditorVisible ( EditorType  type) const

Definition at line 219 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ SetEditorActive()

void yaze::editor::EditorRegistry::SetEditorActive ( EditorType  type,
bool  active 
)

Definition at line 229 of file editor_registry.cc.

References registered_editors_, and ValidateEditorType().

Here is the call graph for this function:

◆ IsValidEditorType()

bool yaze::editor::EditorRegistry::IsValidEditorType ( EditorType  type) const
private

Definition at line 238 of file editor_registry.cc.

References kEditorCategories.

Referenced by ValidateEditorType().

◆ ValidateEditorType()

void yaze::editor::EditorRegistry::ValidateEditorType ( EditorType  type) const
private

Member Data Documentation

◆ kEditorCategories

◆ kEditorNames

const std::unordered_map< EditorType, std::string > yaze::editor::EditorRegistry::kEditorNames
staticprivate
Initial value:
= {
{EditorType::kDungeon, "Dungeon Editor"},
{EditorType::kOverworld, "Overworld Editor"},
{EditorType::kGraphics, "Graphics Editor"},
{EditorType::kPalette, "Palette Editor"},
{EditorType::kSprite, "Sprite Editor"},
{EditorType::kScreen, "Screen Editor"},
{EditorType::kMessage, "Message Editor"},
{EditorType::kMusic, "Music Editor"},
{EditorType::kAssembly, "Assembly Editor"},
{EditorType::kEmulator, "Emulator Editor"},
{EditorType::kHex, "Hex Editor"},
{EditorType::kAgent, "Agent Editor"},
{EditorType::kSettings, "Settings Editor"}
}

Definition at line 61 of file editor_registry.h.

Referenced by GetEditorDisplayName().

◆ kCardBasedEditors

const std::unordered_map< EditorType, bool > yaze::editor::EditorRegistry::kCardBasedEditors
staticprivate
Initial value:

Definition at line 62 of file editor_registry.h.

Referenced by IsCardBasedEditor().

◆ registered_editors_

std::unordered_map<EditorType, Editor*> yaze::editor::EditorRegistry::registered_editors_
private

The documentation for this class was generated from the following files: