yaze 0.2.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
editor.h
Go to the documentation of this file.
1#ifndef YAZE_APP_CORE_EDITOR_H
2#define YAZE_APP_CORE_EDITOR_H
3
4#include <array>
5
6#include "absl/status/status.h"
12
13namespace yaze {
14
19namespace editor {
20
28
41
42constexpr std::array<const char*, 10> kEditorNames = {
43 "Assembly", "Dungeon", "Graphics", "Music", "Overworld",
44 "Palette", "Screen", "Sprite", "Message", "Settings",
45};
46
53class Editor {
54 public:
55 Editor() = default;
56 virtual ~Editor() = default;
57
58 // Initialization of the editor, no ROM assets.
59 virtual void Initialize() = 0;
60
61 // Initialization of ROM assets.
62 virtual absl::Status Load() = 0;
63
64 // Save the editor state.
65 virtual absl::Status Save() = 0;
66
67 // Update the editor state, ran every frame.
68 virtual absl::Status Update() = 0;
69
70 virtual absl::Status Cut() = 0;
71 virtual absl::Status Copy() = 0;
72 virtual absl::Status Paste() = 0;
73
74 virtual absl::Status Undo() = 0;
75 virtual absl::Status Redo() = 0;
76
77 virtual absl::Status Find() = 0;
78
79 EditorType type() const { return type_; }
80
81 void set_context(EditorContext* context) { context_ = context; }
82
83 bool* active() { return &active_; }
84 void set_active(bool active) { active_ = active; }
85
86 protected:
87 bool active_ = false;
90};
91
92} // namespace editor
93} // namespace yaze
94
95#endif // YAZE_APP_CORE_EDITOR_H
void set_context(EditorContext *context)
Definition editor.h:81
virtual absl::Status Cut()=0
virtual absl::Status Copy()=0
virtual absl::Status Redo()=0
bool * active()
Definition editor.h:83
virtual void Initialize()=0
EditorType type() const
Definition editor.h:79
void set_active(bool active)
Definition editor.h:84
virtual ~Editor()=default
EditorType type_
Definition editor.h:88
virtual absl::Status Save()=0
virtual absl::Status Find()=0
virtual absl::Status Paste()=0
virtual absl::Status Load()=0
virtual absl::Status Update()=0
virtual absl::Status Undo()=0
EditorContext * context_
Definition editor.h:89
Editors are the view controllers for the application.
constexpr std::array< const char *, 10 > kEditorNames
Definition editor.h:42
Main namespace for the application.
Definition controller.cc:18
ShortcutManager shortcut_manager
Definition editor.h:26
PopupManager popup_manager
Definition editor.h:25
CommandManager command_manager
Definition editor.h:22
ExtensionManager extension_manager
Definition editor.h:23
HistoryManager history_manager
Definition editor.h:24