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

Instance-based runtime context replacing ContentRegistry::Context. More...

#include <editor_context.h>

Public Member Functions

 GlobalEditorContext (EventBus &bus)
 
EventBusGetEventBus ()
 
const EventBusGetEventBus () const
 
void SetCurrentRom (Rom *rom)
 
RomGetCurrentRom () const
 
void SetSessionId (size_t id)
 
size_t GetSessionId () const
 
void SetGameData (zelda3::GameData *data)
 
zelda3::GameDataGetGameData () const
 
void SetCurrentProject (project::YazeProject *project)
 
project::YazeProjectGetCurrentProject () const
 
void SetCurrentEditor (Editor *editor)
 
EditorGetCurrentEditor () const
 
void Clear ()
 

Private Attributes

EventBusbus_
 
Romrom_ = nullptr
 
size_t session_id_ = 0
 
zelda3::GameDatagame_data_ = nullptr
 
project::YazeProjectproject_ = nullptr
 
Editorcurrent_editor_ = nullptr
 

Detailed Description

Instance-based runtime context replacing ContentRegistry::Context.

Holds all shared runtime state (ROM, GameData, project, editor, event bus) that was previously accessed through the static ContentRegistry::Context API.

New code should receive this via EditorDependencies rather than using ContentRegistry::Context. The static API delegates to the singleton instance set via ContentRegistry::Context::SetGlobalContext().

Definition at line 32 of file editor_context.h.

Constructor & Destructor Documentation

◆ GlobalEditorContext()

yaze::editor::GlobalEditorContext::GlobalEditorContext ( EventBus & bus)
inlineexplicit

Definition at line 34 of file editor_context.h.

Member Function Documentation

◆ GetEventBus() [1/2]

EventBus & yaze::editor::GlobalEditorContext::GetEventBus ( )
inline

Definition at line 37 of file editor_context.h.

References bus_.

Referenced by yaze::editor::StatusBar::Initialize().

◆ GetEventBus() [2/2]

const EventBus & yaze::editor::GlobalEditorContext::GetEventBus ( ) const
inline

Definition at line 38 of file editor_context.h.

References bus_.

◆ SetCurrentRom()

void yaze::editor::GlobalEditorContext::SetCurrentRom ( Rom * rom)
inline

Definition at line 41 of file editor_context.h.

References rom_.

◆ GetCurrentRom()

Rom * yaze::editor::GlobalEditorContext::GetCurrentRom ( ) const
inline

Definition at line 42 of file editor_context.h.

References rom_.

◆ SetSessionId()

void yaze::editor::GlobalEditorContext::SetSessionId ( size_t id)
inline

Definition at line 45 of file editor_context.h.

References session_id_.

◆ GetSessionId()

size_t yaze::editor::GlobalEditorContext::GetSessionId ( ) const
inline

Definition at line 46 of file editor_context.h.

References session_id_.

◆ SetGameData()

void yaze::editor::GlobalEditorContext::SetGameData ( zelda3::GameData * data)
inline

Definition at line 49 of file editor_context.h.

References game_data_.

◆ GetGameData()

zelda3::GameData * yaze::editor::GlobalEditorContext::GetGameData ( ) const
inline

Definition at line 50 of file editor_context.h.

References game_data_.

◆ SetCurrentProject()

void yaze::editor::GlobalEditorContext::SetCurrentProject ( project::YazeProject * project)
inline

Definition at line 53 of file editor_context.h.

References project_.

◆ GetCurrentProject()

project::YazeProject * yaze::editor::GlobalEditorContext::GetCurrentProject ( ) const
inline

Definition at line 54 of file editor_context.h.

References project_.

◆ SetCurrentEditor()

void yaze::editor::GlobalEditorContext::SetCurrentEditor ( Editor * editor)
inline

Definition at line 57 of file editor_context.h.

References current_editor_.

◆ GetCurrentEditor()

Editor * yaze::editor::GlobalEditorContext::GetCurrentEditor ( ) const
inline

Definition at line 58 of file editor_context.h.

References current_editor_.

◆ Clear()

void yaze::editor::GlobalEditorContext::Clear ( )
inline

Definition at line 61 of file editor_context.h.

References current_editor_, game_data_, project_, rom_, and session_id_.

Member Data Documentation

◆ bus_

EventBus& yaze::editor::GlobalEditorContext::bus_
private

Definition at line 70 of file editor_context.h.

Referenced by GetEventBus(), and GetEventBus().

◆ rom_

Rom* yaze::editor::GlobalEditorContext::rom_ = nullptr
private

Definition at line 71 of file editor_context.h.

Referenced by Clear(), GetCurrentRom(), and SetCurrentRom().

◆ session_id_

size_t yaze::editor::GlobalEditorContext::session_id_ = 0
private

Definition at line 72 of file editor_context.h.

Referenced by Clear(), GetSessionId(), and SetSessionId().

◆ game_data_

zelda3::GameData* yaze::editor::GlobalEditorContext::game_data_ = nullptr
private

Definition at line 73 of file editor_context.h.

Referenced by Clear(), GetGameData(), and SetGameData().

◆ project_

project::YazeProject* yaze::editor::GlobalEditorContext::project_ = nullptr
private

Definition at line 74 of file editor_context.h.

Referenced by Clear(), GetCurrentProject(), and SetCurrentProject().

◆ current_editor_

Editor* yaze::editor::GlobalEditorContext::current_editor_ = nullptr
private

Definition at line 75 of file editor_context.h.

Referenced by Clear(), GetCurrentEditor(), and SetCurrentEditor().


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