refactor(new_editor): tighten app dependency boundaries
This commit is contained in:
35
new_editor/app/Commands/EditorEditCommandRoute.h
Normal file
35
new_editor/app/Commands/EditorEditCommandRoute.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
class EditorEditCommandRoute {
|
||||
public:
|
||||
virtual ~EditorEditCommandRoute() = default;
|
||||
|
||||
virtual UIEditorHostCommandEvaluationResult EvaluateEditCommand(
|
||||
std::string_view commandId) const = 0;
|
||||
|
||||
virtual UIEditorHostCommandDispatchResult DispatchEditCommand(
|
||||
std::string_view commandId) = 0;
|
||||
|
||||
virtual UIEditorHostCommandEvaluationResult EvaluateAssetCommand(
|
||||
std::string_view commandId) const {
|
||||
(void)commandId;
|
||||
UIEditorHostCommandEvaluationResult result = {};
|
||||
result.message = "Current panel does not expose asset commands.";
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual UIEditorHostCommandDispatchResult DispatchAssetCommand(
|
||||
std::string_view commandId) {
|
||||
UIEditorHostCommandDispatchResult result = {};
|
||||
result.message = EvaluateAssetCommand(commandId).message;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user