载入中...
搜索中...
未找到
PlayHost.h
浏览该文件的文档.
1#pragma once
2
8#include "common/Export.h"
9#include "common/Result.h"
10#include "common/Value.h"
11
12#include <cstdint>
13#include <string>
14#include <string_view>
15#include <vector>
16
17namespace eve::dev {
18
26public:
28 virtual ~IPlayHostRuntime() = default;
29
31 [[nodiscard]] virtual bool paused() const = 0;
33 [[nodiscard]] virtual std::uint64_t hostFrame() const = 0;
35 virtual void pause() = 0;
37 virtual void play() = 0;
42 [[nodiscard]] virtual Result<void> stepFrames(std::int64_t count) = 0;
47 [[nodiscard]] virtual Result<Value> loadContract() const = 0;
53 [[nodiscard]] virtual Result<Value> observeScriptRoot(std::string_view root,
54 const std::vector<std::string>& fields) const = 0;
60 [[nodiscard]] virtual Result<Value> capturePng(std::string path) = 0;
62 [[nodiscard]] virtual Result<std::string> captureCheckpoint() = 0;
67 [[nodiscard]] virtual Result<void> restoreCheckpoint(std::string_view json) = 0;
69 [[nodiscard]] virtual std::vector<std::string> gameplayDomains() const = 0;
76 [[nodiscard]] virtual Result<Value> invokeScriptAction(std::string_view id,
77 std::string_view source) = 0;
78};
79
88
94
99[[nodiscard]] EVENGINE_API_FOUNDATION Result<std::string> executePlayJson(std::string_view requestJson);
100
101} // namespace eve::dev
int root
Definition AnimSmr.cpp:119
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
const GltfImportRequest & request
std::string path
Definition PlayHost.cpp:110
std::vector< std::string > fields
Definition PlayHost.cpp:111
Move-only, checked operation results for the common layer.
std::uint32_t count
const UnitySourceAsset & source
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:155
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
Injected runtime used by Play Host. Tests supply a fake; MCP uses the engine adapter....
Definition PlayHost.h:25
virtual ~IPlayHostRuntime()=default
Releases IPlayHostRuntime resources.
virtual Result< Value > observeScriptRoot(std::string_view root, const std::vector< std::string > &fields) const =0
Project one marked script root without evaluating arbitrary code.
virtual Result< void > stepFrames(std::int64_t count)=0
Request count host frames then pause.
virtual bool paused() const =0
Whether the host clock is paused.
virtual Result< void > restoreCheckpoint(std::string_view json)=0
Restore a previously captured checkpoint.
virtual Result< Value > capturePng(std::string path)=0
Capture the last presented frame through IRenderCapture.
virtual std::vector< std::string > gameplayDomains() const =0
Published gameplay-control domain names, sorted.
virtual Result< Value > loadContract() const =0
Load game.agent.json as an owning Value object.
virtual void pause()=0
Pause the host clock.
virtual std::uint64_t hostFrame() const =0
Monotonic host-frame counter owned by this runtime (0 if unknown).
virtual Result< Value > invokeScriptAction(std::string_view id, std::string_view source)=0
Run one contract-mapped script snippet. Not an open eval surface.
virtual void play()=0
Resume free-running host clock.
virtual Result< std::string > captureCheckpoint()=0
Capture marked script snapshot JSON.
Result< std::string > executePlayJson(std::string_view requestJson)
Parse, execute and serialize one Play JSON request against the live engine.
Definition PlayHost.cpp:866
Result< Value > executePlayRequest(const Value &request, IPlayHostRuntime &runtime)
Execute one versioned Play request against an injected runtime.
Definition PlayHost.cpp:858