Refactor EditorContext and system managers for improved clarity and consistency
This commit is contained in:
@@ -20,11 +20,11 @@ namespace app {
|
|||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
struct EditorContext {
|
struct EditorContext {
|
||||||
static ConstantManager constant_manager;
|
ConstantManager constant_manager;
|
||||||
static CommandManager command_manager;
|
CommandManager command_manager;
|
||||||
static ExtensionManager extension_manager;
|
ExtensionManager extension_manager;
|
||||||
static HistoryManager history_manager;
|
HistoryManager history_manager;
|
||||||
static ResourceManager resource_manager;
|
ResourceManager resource_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EditorType {
|
enum class EditorType {
|
||||||
@@ -52,7 +52,7 @@ constexpr std::array<const char *, 10> kEditorNames = {
|
|||||||
* Provides basic editing operations that each editor should implement.
|
* Provides basic editing operations that each editor should implement.
|
||||||
*/
|
*/
|
||||||
class Editor {
|
class Editor {
|
||||||
public:
|
public:
|
||||||
Editor() = default;
|
Editor() = default;
|
||||||
virtual ~Editor() = default;
|
virtual ~Editor() = default;
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ public:
|
|||||||
|
|
||||||
EditorType type() const { return type_; }
|
EditorType type() const { return type_; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
EditorType type_;
|
EditorType type_;
|
||||||
EditorContext context_;
|
EditorContext context_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ ImGuiKey MapKeyToImGuiKey(char key);
|
|||||||
|
|
||||||
class CommandManager {
|
class CommandManager {
|
||||||
public:
|
public:
|
||||||
|
CommandManager() = default;
|
||||||
|
~CommandManager() = default;
|
||||||
|
|
||||||
using Command = std::function<void()>;
|
using Command = std::function<void()>;
|
||||||
|
|
||||||
struct CommandInfo {
|
struct CommandInfo {
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ namespace editor {
|
|||||||
// System resource manager.
|
// System resource manager.
|
||||||
class ResourceManager {
|
class ResourceManager {
|
||||||
public:
|
public:
|
||||||
ResourceManager();
|
ResourceManager() : count_(0) {}
|
||||||
~ResourceManager();
|
~ResourceManager() = default;
|
||||||
|
|
||||||
void Load(const char* path);
|
void Load(const char* path);
|
||||||
void Unload(const char* path);
|
void Unload(const char* path);
|
||||||
|
|||||||
Reference in New Issue
Block a user