载入中...
搜索中...
未找到
GameWorldContext.hpp
浏览该文件的文档.
1#pragma once
2
21#include "common/Export.h"
22#include "common/Result.h"
23#include "common/Value.h"
24
25#include <cstdint>
26#include <string>
27#include <string_view>
28#include <vector>
29
30struct SQVM;
31typedef struct SQVM* HSQUIRRELVM;
32
33namespace eve::dev {
34
36inline constexpr std::string_view kGameWorldSchemaId = "evengine.game-world";
38inline constexpr std::int64_t kGameWorldSchemaVersion = 1;
39
48
55
58
60[[nodiscard]] EVENGINE_API_FOUNDATION bool hasWorldContext() noexcept;
61
66[[nodiscard]] EVENGINE_API_FOUNDATION const Value* runtimeWorldContext() noexcept;
67
74 std::string contractId;
76 bool contractLoaded = false;
78 std::string gameRoot;
80 std::string configTitle;
82 std::vector<std::string> domains;
84 std::vector<std::string> configuredModules;
86 std::vector<std::string> liveModules;
87};
88
95
100[[nodiscard]] EVENGINE_API_FOUNDATION std::string readConfigTitle(HSQUIRRELVM vm);
101
106[[nodiscard]] EVENGINE_API_FOUNDATION std::vector<std::string> readConfiguredModules(HSQUIRRELVM vm);
107
112[[nodiscard]] EVENGINE_API_FOUNDATION std::vector<std::string> readLiveModules(HSQUIRRELVM vm);
113
120
121} // namespace eve::dev
struct SQVM * HSQUIRRELVM
HSQUIRRELVM vm
Definition ECS.cpp:38
EvpackChunkInput input
Definition Evpack.cpp:170
#define EVENGINE_API_FOUNDATION
每个链接组(link group)各自的导出宏。
Definition Export.h:106
struct SQVM * HSQUIRRELVM
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
std::vector< std::string > readConfiguredModules(HSQUIRRELVM vm)
Read config.modules / optionalModules from the attached VM root.
Result< Value > buildGameWorldSnapshot(const GameWorldSnapshotInput &input)
Assemble runtime world brief plus live system lists.
constexpr std::int64_t kGameWorldSchemaVersion
Schema version for the game-world snapshot.
constexpr std::string_view kGameWorldSchemaId
Schema id for the game-world snapshot returned to agents.
std::string readConfigTitle(HSQUIRRELVM vm)
Read config.title from the attached VM root.
Result< Value > liveGameWorldSnapshot()
Build the Discover snapshot against the live engine.
void clearWorldContext()
Drop the runtime world brief (soft restart with script reload).
std::vector< std::string > readLiveModules(HSQUIRRELVM vm)
List instantiated module slots declared in eve.moduleList.
Result< Value > parseWorldObject(const Value &world)
Validate one runtime-published world object.
const Value * runtimeWorldContext() noexcept
Current runtime brief, or null when none is published. @ownership Borrowed; valid until the next publ...
Result< void > publishWorldContext(Value world)
Replace the runtime world brief published by the live game script.
bool hasWorldContext() noexcept
Whether a runtime brief is currently published.
Inputs used to assemble one Discover snapshot. @ownership Callers own the pointed-to Values; they are...
std::string gameRoot
Absolute or relative game root reported to agents.
std::vector< std::string > liveModules
Instantiated module slot names when readable from the VM.
std::vector< std::string > configuredModules
config.modules (+ optionalModules) when readable from the VM.
std::string configTitle
config.title when readable from the VM (window / project title).
std::string contractId
Contract id when a Play contract loaded; empty otherwise.
std::vector< std::string > domains
Published gameplay-control domain names (sorted).