yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor_context.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_CORE_EDITOR_CONTEXT_H_
2#define YAZE_APP_EDITOR_CORE_EDITOR_CONTEXT_H_
3
5
6namespace yaze {
7class Rom;
8
9namespace project {
10struct YazeProject;
11} // namespace project
12
13namespace zelda3 {
14class GameData;
15} // namespace zelda3
16
17namespace editor {
18
19class Editor;
20
33 public:
34 explicit GlobalEditorContext(EventBus& bus) : bus_(bus) {}
35
36 // --- Event bus ---
37 EventBus& GetEventBus() { return bus_; }
38 const EventBus& GetEventBus() const { return bus_; }
39
40 // --- ROM ---
41 void SetCurrentRom(Rom* rom) { rom_ = rom; }
42 Rom* GetCurrentRom() const { return rom_; }
43
44 // --- Session ---
45 void SetSessionId(size_t id) { session_id_ = id; }
46 size_t GetSessionId() const { return session_id_; }
47
48 // --- Game data ---
49 void SetGameData(zelda3::GameData* data) { game_data_ = data; }
51
52 // --- Project ---
53 void SetCurrentProject(project::YazeProject* project) { project_ = project; }
55
56 // --- Current editor ---
57 void SetCurrentEditor(Editor* editor) { current_editor_ = editor; }
59
60 // --- Bulk clear ---
61 void Clear() {
62 rom_ = nullptr;
63 game_data_ = nullptr;
64 project_ = nullptr;
65 current_editor_ = nullptr;
66 session_id_ = 0;
67 }
68
69 private:
71 Rom* rom_ = nullptr;
72 size_t session_id_ = 0;
76};
77
78} // namespace editor
79} // namespace yaze
80
81#endif // YAZE_APP_EDITOR_CORE_EDITOR_CONTEXT_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
Interface for editor classes.
Definition editor.h:236
Instance-based runtime context replacing ContentRegistry::Context.
project::YazeProject * GetCurrentProject() const
void SetCurrentProject(project::YazeProject *project)
const EventBus & GetEventBus() const
zelda3::GameData * GetGameData() const
void SetGameData(zelda3::GameData *data)
project::YazeProject * project_
void SetCurrentEditor(Editor *editor)
Modern project structure with comprehensive settings consolidation.
Definition project.h:120