Files
XCEngine/new_editor/app/Scene/EditorSceneBridge.h

45 lines
1.3 KiB
C++

#pragma once
#include <XCEngine/Components/GameObject.h>
#include <filesystem>
#include <optional>
#include <string>
#include <string_view>
namespace XCEngine::Components {
class Scene;
} // namespace XCEngine::Components
namespace XCEngine::UI::Editor::App {
struct EditorStartupSceneResult {
bool ready = false;
bool loadedFromDisk = false;
std::filesystem::path scenePath = {};
std::string sceneName = {};
};
EditorStartupSceneResult EnsureEditorStartupScene(
const std::filesystem::path& projectRoot);
::XCEngine::Components::Scene* GetActiveEditorScene();
bool OpenEditorSceneAsset(const std::filesystem::path& scenePath);
std::string MakeEditorGameObjectItemId(::XCEngine::Components::GameObject::ID id);
std::optional<::XCEngine::Components::GameObject::ID> ParseEditorGameObjectItemId(
std::string_view itemId);
::XCEngine::Components::GameObject* FindEditorGameObject(std::string_view itemId);
bool RenameEditorGameObject(
std::string_view itemId,
std::string_view newName);
bool DeleteEditorGameObject(std::string_view itemId);
std::string DuplicateEditorGameObject(std::string_view itemId);
bool ReparentEditorGameObject(
std::string_view itemId,
std::string_view parentItemId);
bool MoveEditorGameObjectToRoot(std::string_view itemId);
} // namespace XCEngine::UI::Editor::App