refactor(new_editor): tighten app dependency boundaries
This commit is contained in:
73
new_editor/app/State/EditorSession.h
Normal file
73
new_editor/app/State/EditorSession.h
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace XCEngine::UI::Editor {
|
||||
|
||||
class UIEditorWorkspaceController;
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
enum class EditorRuntimeMode : std::uint8_t {
|
||||
Edit = 0,
|
||||
Play,
|
||||
Paused
|
||||
};
|
||||
|
||||
enum class EditorActionRoute : std::uint8_t {
|
||||
None = 0,
|
||||
Hierarchy,
|
||||
Project,
|
||||
Inspector,
|
||||
Console,
|
||||
Scene,
|
||||
Game
|
||||
};
|
||||
|
||||
enum class EditorSelectionKind : std::uint8_t {
|
||||
None = 0,
|
||||
HierarchyNode,
|
||||
ProjectItem
|
||||
};
|
||||
|
||||
struct EditorSelectionState {
|
||||
EditorSelectionKind kind = EditorSelectionKind::None;
|
||||
std::string itemId = {};
|
||||
std::string displayName = {};
|
||||
std::filesystem::path absolutePath = {};
|
||||
bool directory = false;
|
||||
std::uint64_t stamp = 0u;
|
||||
};
|
||||
|
||||
struct EditorConsoleEntry {
|
||||
std::string channel = {};
|
||||
std::string message = {};
|
||||
};
|
||||
|
||||
struct EditorSession {
|
||||
std::filesystem::path repoRoot = {};
|
||||
std::filesystem::path projectRoot = {};
|
||||
std::string activePanelId = {};
|
||||
EditorRuntimeMode runtimeMode = EditorRuntimeMode::Edit;
|
||||
EditorActionRoute activeRoute = EditorActionRoute::None;
|
||||
EditorSelectionState selection = {};
|
||||
std::vector<EditorConsoleEntry> consoleEntries = {};
|
||||
};
|
||||
|
||||
std::string_view GetEditorRuntimeModeName(EditorRuntimeMode mode);
|
||||
std::string_view GetEditorActionRouteName(EditorActionRoute route);
|
||||
std::string_view GetEditorSelectionKindName(EditorSelectionKind kind);
|
||||
|
||||
EditorActionRoute ResolveEditorActionRoute(std::string_view panelId);
|
||||
|
||||
void SyncEditorSessionFromWorkspace(
|
||||
EditorSession& session,
|
||||
const UIEditorWorkspaceController& controller);
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user