feat: add runtime play tick and play-mode scene editing semantics
This commit is contained in:
35
editor/src/Core/PlaySessionController.h
Normal file
35
editor/src/Core/PlaySessionController.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "EditorRuntimeMode.h"
|
||||
#include "SceneSnapshot.h"
|
||||
|
||||
#include <XCEngine/Scene/RuntimeLoop.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace XCEngine {
|
||||
namespace Editor {
|
||||
|
||||
class IEditorContext;
|
||||
|
||||
class PlaySessionController {
|
||||
public:
|
||||
void Attach(IEditorContext& context);
|
||||
void Detach(IEditorContext& context);
|
||||
|
||||
void Update(IEditorContext& context, float deltaTime);
|
||||
|
||||
bool StartPlay(IEditorContext& context);
|
||||
bool StopPlay(IEditorContext& context);
|
||||
bool PausePlay(IEditorContext& context);
|
||||
|
||||
private:
|
||||
uint64_t m_playStartRequestedHandlerId = 0;
|
||||
uint64_t m_playStopRequestedHandlerId = 0;
|
||||
uint64_t m_playPauseRequestedHandlerId = 0;
|
||||
SceneSnapshot m_editorSnapshot = {};
|
||||
XCEngine::Components::RuntimeLoop m_runtimeLoop;
|
||||
};
|
||||
|
||||
} // namespace Editor
|
||||
} // namespace XCEngine
|
||||
Reference in New Issue
Block a user