载入中...
搜索中...
未找到
LevelFormat.cpp
浏览该文件的文档.
2#include "common/Json.h"
5
6#include <algorithm>
7#include <atomic>
8#include <bit>
9#include <charconv>
10#include <chrono>
11#include <cmath>
12#include <filesystem>
13#include <fstream>
14#include <limits>
15#include <map>
16#include <set>
17#include <sstream>
18
19#if defined(_WIN32)
20#ifndef NOMINMAX
21#define NOMINMAX
22#endif
23#include <windows.h>
24#endif
25
26namespace eve::level_editing {
27namespace {
30
31bool validProperties(eve::json::Value value) {
32 if (!value) return true;
33 if (value.isObject()) {
34 for (const auto& key : value.keys()) {
35 auto item = value.get(key.c_str());
36 if (!item.isString() && !item.isBool() && !item.isNumber()) return false;
37 }
38 return true;
39 }
40 if (!value.isArray()) return false;
41 std::set<std::string> names;
42 for (size_t index = 0; index < value.size(); ++index) {
43 auto item = value.at(index);
44 if (!item.isObject() || !item.get("name").isString() || !item.get("value") ||
45 !names.insert(item.getString("name")).second)
46 return false;
47 }
48 return true;
49}
50
51bool validNumbers(eve::json::Value value, std::initializer_list<const char*> fields) {
52 for (const auto* key : fields) {
53 auto item = value.get(key);
54 if (item && (!item.isNumber() || !std::isfinite(item.asFloat()))) return false;
55 }
56 return true;
57}
58
59bool validId(const eve::Value& object, bool tiled) {
60 const auto* id = object.find("id");
61 if (!id) return true;
62 return tiled ? id->isInt64() && id->asInt() > 0 && id->asInt() < std::numeric_limits<int>::max()
63 : id->isString() && !id->asString().empty();
64}
65
66eve::Value::Object extraFields(const eve::Value& value, std::initializer_list<const char*> known) {
67 Object out;
68 if (const auto* fields = value.getIf<Object>()) {
69 for (const auto& [key, field] : *fields) {
70 if (std::none_of(known.begin(), known.end(), [&](const char* name) { return key == name; }))
71 out.emplace(key, field);
72 }
73 }
74 return out;
75}
76
77// String properties remain in the existing editable map; other typed properties
78// retain their complete Tiled records, without a second copy of editable values.
79void readProperties(eve::json::Value v, const eve::Value* owned, std::unordered_map<std::string, std::string>& out,
80 Object& extras) {
81 extras.erase("properties");
82 if (v.isObject()) {
83 Object typed;
84 for (const auto& k : v.keys()) {
85 if (v.get(k.c_str()).isString())
86 out[k] = v.get(k.c_str()).asString();
87 else if (owned)
88 typed[k] = *owned->find(k);
89 }
90 if (!typed.empty()) extras["properties"] = std::move(typed);
91 } else if (v.isArray()) {
92 Array typed;
93 for (size_t i = 0; i < v.size(); ++i) {
94 auto p = v.at(i);
95 if (p.getString("type", "string") == "string" && p.get("value").isString() && p.keys().size() == 3)
96 out[p.getString("name")] = p.get("value").asString();
97 else if (owned)
98 typed.push_back(owned->at(i));
99 }
100 if (!typed.empty()) extras["properties"] = std::move(typed);
101 }
102}
103
104eve::Value propertyValue(const std::unordered_map<std::string, std::string>& properties, const Object& extras,
105 bool tiled) {
106 const auto found = extras.find("properties");
107 if (!tiled && (found == extras.end() || found->second.isObject())) {
108 Object out = found == extras.end() ? Object{} : *found->second.getIf<Object>();
109 for (const auto& [key, value] : properties) out[key] = value;
110 return out;
111 }
112 Array out;
113 if (found != extras.end() && found->second.isArray()) {
114 for (const auto& item : *found->second.getIf<Array>()) {
115 const auto* name = item.find("name");
116 if (!name || !name->isString() || !properties.contains(name->asString())) out.push_back(item);
117 }
118 }
119 if (found != extras.end() && found->second.isObject()) {
120 for (const auto& [key, value] : *found->second.getIf<Object>()) {
121 if (properties.contains(key)) continue;
122 out.emplace_back(Object{{"name", key},
123 {"type", value.isBool() ? "bool"
124 : value.isInt64() ? "int"
125 : "float"},
126 {"value", value}});
127 }
128 }
129 // Sort the editable map before emission to make saves deterministic.
130 for (const auto& [key, value] : std::map<std::string, std::string>(properties.begin(), properties.end()))
131 out.emplace_back(Object{{"name", key}, {"type", "string"}, {"value", value}});
132 return out;
133}
134
135std::int64_t numericId(const std::string& id) {
136 std::int64_t value = 0;
137 auto parsed = std::from_chars(id.data(), id.data() + id.size(), value);
138 return parsed.ec == std::errc{} && parsed.ptr == id.data() + id.size() && value > 0 &&
139 value < std::numeric_limits<int>::max()
140 ? value
141 : 0;
142}
143} // namespace
144
145// Sole codec for the owned document and its unmodeled format fields.
147public:
148 static Object& extensions(LevelDocument& document) { return document.extensions_; }
149 static const Object& extensions(const LevelDocument& document) { return document.extensions_; }
150};
151
152namespace {
153class JsonLevelFormat final : public LevelFormat {
154public:
155 std::string id() const override { return "eve.level"; }
156 std::vector<std::string> extensions() const override { return {".level.json", ".evelevel"}; }
157 bool canRead(const std::string& s) const override {
159 return d.valid() && d.root().getString("format") == "eve.level";
160 }
161 eve::Result<std::unique_ptr<LevelDocument>> read(const std::string& s) const override { return readJson(s, false); }
162 eve::Result<std::string> write(const LevelDocument& d) const override { return writeJson(d, false); }
163 static eve::Result<std::unique_ptr<LevelDocument>> readJson(const std::string& s, bool tiled) {
164 std::string error;
165 auto json = eve::json::Document::parse(s, &error);
166 if (!json.valid())
170 if (!owned.ok()) return eve::Result<std::unique_ptr<LevelDocument>>::failure(owned.status());
171 const auto fail = [](const std::string& message, eve::DiagnosticCode code = eve::DiagnosticCode::Unsupported) {
173 eve::Diagnostic::error(code, message, {}, {}, "editor.level"));
174 };
175 auto r = json.root();
176 if (!r.isObject()) return fail("Map root must be an object", eve::DiagnosticCode::ParseError);
177 const auto* version = owned.value().find("version");
178 if (!tiled &&
179 (r.getString("format") != "eve.level" || (version && (!version->isInt64() || version->asInt() != 1))))
180 return fail("Unsupported eve.level schema version");
181 if (tiled && r.getString("type") != "map") return fail("Expected a Tiled map");
182 if (r.getBool("infinite", false)) return fail("Infinite maps are not yet editable by LevelDocument");
183 if (!validProperties(r.get("properties")) || !validNumbers(r, {"tilewidth", "tileheight"}))
184 return fail("Invalid map properties or tile dimensions", eve::DiagnosticCode::ParseError);
185 int w = r.getInt("width"), h = r.getInt("height");
186 const auto* widthValue = owned.value().find("width");
187 const auto* heightValue = owned.value().find("height");
188 if (!widthValue || !heightValue || !widthValue->isInt64() || !heightValue->isInt64())
189 return fail("Map dimensions must be integers", eve::DiagnosticCode::ParseError);
190 float tw = r.getFloat("tilewidth", 32), th = r.getFloat("tileheight", 32);
191 if (w < 1 || h < 1 || int64_t(w) * h > 16 * 1024 * 1024 || !std::isfinite(tw) || !std::isfinite(th) ||
192 tw <= 0 || th <= 0) {
195 "map dimensions must be positive, finite and within the 16M-cell budget", {}, {}, "editor.level"));
196 }
197 const std::string orientation = r.getString("orientation", "orthogonal");
198 if (orientation != "orthogonal" && orientation != "isometric" && orientation != "staggered" &&
199 orientation != "hexagonal")
200 return fail("Unsupported map orientation");
201 auto out = std::make_unique<LevelDocument>(w, h, tw, th);
202 out->setOrientation(orientation);
203 LevelFormatCodec::extensions(*out) = extraFields(
204 owned.value(),
205 {"format", "version", "type", "width", "height", "tilewidth", "tileheight", "orientation", "layers"});
206 readProperties(r.get("properties"), owned.value().find("properties"), out->properties(),
208 auto ls = r.get("layers");
209 if (!ls.isArray()) return fail("Map layers must be an array", eve::DiagnosticCode::ParseError);
210 std::set<std::string> layerIds, objectIds;
211 for (size_t i = 0; i < ls.size(); ++i) {
212 auto v = ls.at(i);
213 std::string kind = v.getString("type");
214 bool obj = kind == "objectgroup" || kind == "objects";
215 if (!v.isObject() || (!obj && kind != "tilelayer" && kind != "tiles"))
216 return fail("Unsupported layer type: " + kind);
217 if (!validId(owned.value().find("layers")->at(i), tiled) || !validProperties(v.get("properties")) ||
218 !validNumbers(v, {"opacity", "offsetx", "offsety"}) || v.getFloat("opacity", 1) < 0 ||
219 v.getFloat("opacity", 1) > 1)
220 return fail("Invalid layer identity, properties or presentation", eve::DiagnosticCode::ParseError);
221 if (v.get("chunks") || v.get("encoding") || v.get("compression"))
222 return fail("Chunked or encoded tile layers require the runtime importer; editing is not supported");
223 if (!obj && (v.getInt("width", w) != w || v.getInt("height", h) != h))
224 return fail("Layer dimensions must match the editable map");
225 int li = obj ? out->addObjectLayer(v.getString("name")) : out->addTileLayer(v.getString("name"));
226 auto layerRef = out->layer(li);
227 auto* l = &layerRef->get();
228 l->id = tiled ? std::to_string(v.getInt("id", int(i + 1))) : v.getString("id", l->id);
229 if (!layerIds.insert(l->id).second) return fail("Duplicate layer id", eve::DiagnosticCode::ParseError);
230 l->extensions = extraFields(owned.value().find("layers")->at(i),
231 {"id", "name", "type", "visible", "locked", "opacity", "offsetx", "offsety",
232 "objects", "data", "width", "height"});
233 l->locked = v.getBool("locked", false);
234 l->visible = v.getBool("visible", true);
235 l->opacity = v.getFloat("opacity", 1);
236 l->offsetX = v.getFloat("offsetx", 0);
237 l->offsetY = v.getFloat("offsety", 0);
238 readProperties(v.get("properties"), owned.value().find("layers")->at(i).find("properties"), l->properties,
239 l->extensions);
240 if (obj) {
241 auto os = v.get("objects");
242 if (!os.isArray()) return fail("Objects must be an array", eve::DiagnosticCode::ParseError);
243 for (size_t j = 0; j < os.size(); ++j) {
244 auto q = os.at(j);
245 if (!q.isObject()) return fail("Map object must be an object", eve::DiagnosticCode::ParseError);
246 if (!validId(owned.value().find("layers")->at(i).find("objects")->at(j), tiled) ||
247 !validProperties(q.get("properties")) ||
248 !validNumbers(q, {"x", "y", "width", "height", "rotation"}))
249 return fail("Invalid object identity, properties or transform",
251 const std::string objectClass = q.getString("class");
252 int oi = out->addObject(li, objectClass.empty() ? q.getString("type") : objectClass,
253 q.getFloat("x"), q.getFloat("y"));
254 auto objectRef = out->object(li, oi);
255 auto* ob = &objectRef->get();
256 ob->id = tiled ? std::to_string(q.getInt("id", int(j + 1))) : q.getString("id", ob->id);
257 if (!objectIds.insert(ob->id).second)
258 return fail("Duplicate object id", eve::DiagnosticCode::ParseError);
259 const auto& ownedObject = owned.value().find("layers")->at(i).find("objects")->at(j);
260 ob->extensions = extraFields(ownedObject, {"id", "name", "type", "class", "x", "y", "width",
261 "height", "rotation", "visible"});
262 ob->name = q.getString("name");
263 ob->width = q.getFloat("width");
264 ob->height = q.getFloat("height");
265 ob->rotation = q.getFloat("rotation");
266 ob->visible = q.getBool("visible", true);
267 readProperties(q.get("properties"), ownedObject.find("properties"), ob->properties, ob->extensions);
268 }
269 } else {
270 auto data = v.get("data");
271 if (!data.isArray() || data.size() != size_t(w) * size_t(h))
272 return fail("Tile data must contain exactly width * height GIDs", eve::DiagnosticCode::ParseError);
273 for (size_t n = 0; n < data.size(); ++n) {
274 const auto& raw = owned.value().find("layers")->at(i).find("data")->at(n);
275 // Native v1 historically emitted signed int GIDs. Accept
276 // that representation only on native import; emit uint32.
277 const int64_t minimumGid = tiled ? 0 : std::numeric_limits<int32_t>::min();
278 if (!raw.isInt64() || raw.asInt() < minimumGid ||
279 raw.asInt() > std::numeric_limits<uint32_t>::max())
280 return fail("Tile GID must be an unsigned 32-bit integer", eve::DiagnosticCode::ParseError);
281 l->tiles->setGid(int(n) % w, int(n) / w, std::bit_cast<int>(uint32_t(raw.asInt())));
282 }
283 }
284 }
285 return eve::Result<std::unique_ptr<LevelDocument>>::success(std::move(out));
286 }
287 static eve::Result<std::string> writeJson(const LevelDocument& d, bool tiled) {
289 if (!tiled)
290 root["format"] = "eve.level";
291 else
292 root["type"] = "map";
293 root["version"] = tiled ? eve::Value("1.10") : eve::Value(1);
294 root["orientation"] = d.getOrientation();
295 root["width"] = d.getWidth();
296 root["height"] = d.getHeight();
297 root["tilewidth"] = d.getTileWidth();
298 root["tileheight"] = d.getTileHeight();
299 root["properties"] = propertyValue(d.properties(), LevelFormatCodec::extensions(d), tiled);
300 int64_t nextLayer = 1, nextObject = 1;
301 for (const auto& layer : d.layers()) {
302 nextLayer = std::max(nextLayer, numericId(layer.id) + 1);
303 for (const auto& object : layer.objects) nextObject = std::max(nextObject, numericId(object.id) + 1);
304 }
305 Array layers;
306 for (const auto& layer : d.layers()) {
307 Object value = layer.extensions;
308 value["id"] =
309 tiled ? eve::Value(numericId(layer.id) ? numericId(layer.id) : nextLayer++) : eve::Value(layer.id);
310 value["name"] = layer.name;
311 value["type"] = layer.kind == LevelLayer::Kind::Tiles ? "tilelayer" : "objectgroup";
312 value["visible"] = layer.visible;
313 value["locked"] = layer.locked;
314 value["opacity"] = layer.opacity;
315 value["offsetx"] = layer.offsetX;
316 value["offsety"] = layer.offsetY;
317 value["properties"] = propertyValue(layer.properties, layer.extensions, tiled);
318 if (layer.tiles) {
319 value["width"] = d.getWidth();
320 value["height"] = d.getHeight();
321 Array data;
322 for (int y = 0; y < d.getHeight(); ++y)
323 for (int x = 0; x < d.getWidth(); ++x)
324 data.emplace_back(int64_t(uint32_t(layer.tiles->getGid(x, y))));
325 value["data"] = std::move(data);
326 } else {
328 for (const auto& object : layer.objects) {
329 Object item = object.extensions;
330 item["id"] = tiled ? eve::Value(numericId(object.id) ? numericId(object.id) : nextObject++)
331 : eve::Value(object.id);
332 item["name"] = object.name;
333 item["type"] = object.type;
334 if (tiled) item["class"] = object.type;
335 item["x"] = object.x;
336 item["y"] = object.y;
337 item["width"] = object.width;
338 item["height"] = object.height;
339 item["rotation"] = object.rotation;
340 item["visible"] = object.visible;
341 item["properties"] = propertyValue(object.properties, object.extensions, tiled);
342 objects.emplace_back(std::move(item));
343 }
344 value["objects"] = std::move(objects);
345 }
346 layers.emplace_back(std::move(value));
347 }
348 if (tiled) {
349 root["nextlayerid"] = nextLayer;
350 root["nextobjectid"] = nextObject;
351 }
352 root["layers"] = std::move(layers);
354 }
355};
356class TiledFormat final : public LevelFormat {
357public:
358 std::string id() const override { return "tiled.json"; }
359 std::vector<std::string> extensions() const override { return {".tmj", ".json"}; }
360 bool canRead(const std::string& s) const override {
362 return d.valid() && d.root().getString("type") == "map";
363 }
364 eve::Result<std::unique_ptr<LevelDocument>> read(const std::string& s) const override {
365 return JsonLevelFormat::readJson(s, true);
366 }
367 eve::Result<std::string> write(const LevelDocument& d) const override {
368 return JsonLevelFormat::writeJson(d, true);
369 }
370};
371} // namespace
372
374 registerFormat(std::make_unique<JsonLevelFormat>()).expect("register native level format");
375 registerFormat(std::make_unique<TiledFormat>()).expect("register Tiled level format");
376}
378 if (!f)
380 eve::DiagnosticCode::InvalidArgument, "level format must not be null", {}, {}, "editor.level"));
381 for (auto& i : formats_)
382 if (i->id() == f->id()) {
383 i = std::move(f);
385 }
386 formats_.push_back(std::move(f));
388}
389std::string LevelFormatRegistry::getFormatId(int i) const {
390 return i < 0 || i >= int(formats_.size()) ? std::string() : formats_[i]->id();
391}
392eve::OptionalRef<const LevelFormat> LevelFormatRegistry::find(const std::string& id) const {
393 for (auto& i : formats_)
394 if (i->id() == id) return std::cref(*i);
395 return {};
396}
397std::string LevelFormatRegistry::detect(const std::string& p, const std::string& t) const {
398 for (auto& i : formats_)
399 if (i->canRead(t)) return i->id();
400 for (auto& i : formats_)
401 for (auto& e : i->extensions())
402 if (p.size() >= e.size() && p.compare(p.size() - e.size(), e.size(), e) == 0) return i->id();
403 return {};
404}
406 const std::string& t) const {
407 auto f = find(id);
408 if (!f)
410 eve::DiagnosticCode::Unsupported, "unknown level format: " + id, {}, {}, "editor.level"));
411 return f->get().read(t);
412}
414 auto f = find(id);
415 if (!f)
417 eve::DiagnosticCode::Unsupported, "unknown level format: " + id, {}, {}, "editor.level"));
418 return f->get().write(d);
419}
421 const std::string& id) const {
422 std::ifstream f(p, std::ios::binary);
423 if (!f) {
425 eve::Diagnostic::error(eve::DiagnosticCode::NotFound, "cannot open level", p, {}, "editor.level"));
426 }
427 std::ostringstream s;
428 s << f.rdbuf();
429 auto fmt = id.empty() ? detect(p, s.str()) : id;
430 return decode(fmt, s.str());
431}
432eve::Result<void> LevelFormatRegistry::save(const std::string& p, const LevelDocument& d, const std::string& id) const {
433 auto fmt = id.empty() ? detect(p, "") : id;
434 if (fmt.empty()) fmt = "eve.level";
435 auto encoded = encode(fmt, d);
436 if (!encoded) return eve::Result<void>::failure(encoded.status());
437 const std::filesystem::path destination(p);
438 // A uniquely created sibling directory reserves our temporary path. The
439 // rename stays on the destination filesystem and never truncates its file.
440 static std::atomic<unsigned long long> sequence{0};
441 std::filesystem::path staging;
442 std::error_code error;
443 for (int attempt = 0; attempt < 8; ++attempt) {
444 staging = destination;
445 staging += ".save-" + std::to_string(std::chrono::steady_clock::now().time_since_epoch().count()) + "-" +
446 std::to_string(sequence.fetch_add(1));
447 if (std::filesystem::create_directory(staging, error)) break;
448 staging.clear();
449 if (error) break;
450 }
451 if (staging.empty())
453 eve::DiagnosticCode::Failed, "cannot create save staging directory", p, {}, "editor.level"));
454 struct StagingCleanup {
455 std::filesystem::path path;
456 ~StagingCleanup() {
457 std::error_code ignored;
458 std::filesystem::remove_all(path, ignored);
459 }
460 } cleanup{staging};
461 const auto temporary = staging / "document.json";
462 std::ofstream f(temporary, std::ios::binary);
463 if (!f) {
465 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "cannot write level", p, {}, "editor.level"));
466 }
467 f << encoded.value();
468 f.close();
469 if (!f)
471 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "failed while writing level", p, {}, "editor.level"));
472#if defined(_WIN32)
473 if (!MoveFileExW(temporary.c_str(), destination.c_str(), MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH))
475 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "cannot replace level file", p, {}, "editor.level"));
476#else
477 std::filesystem::rename(temporary, destination, error);
478 if (error)
480 eve::DiagnosticCode::Failed, "cannot replace level file: " + error.message(), p, {}, "editor.level"));
481#endif
483}
484} // namespace eve::level_editing
double y
double x
float w
Definition AnimClip.cpp:738
int root
Definition AnimSmr.cpp:119
ActiveSource owned
const std::string & s
glm::vec4 p[6]
SQObjectPtr key
Definition ECS.cpp:155
std::string name
Definition ECS.cpp:154
std::vector< std::string > fields
Definition ECS.cpp:42
double raw
std::string message
DiagnosticCode code
glm::vec3 n
Definition Grass.cpp:63
std::array< double, 10 > q
double r
float v
std::int32_t second
int h
std::function< void(b3JointId, const Numbers &)> write
std::function< Numbers(b3JointId)> read
std::map< std::string, PropertyRule > properties
std::string id
std::unique_ptr< gpgpu::Sequence > sequence
Definition OnnxGpgpu.cpp:43
std::string error
Definition Package.cpp:174
TileLayer * layer
float f
std::string path
Definition PlayHost.cpp:111
Object::Ptr value
float d
float t
bool found
ScriptStructure out
size_t begin
size_t end
std::string kind
std::string string
int count
Share string attribute map operations through the Windows Foundation DLL.
Json object
float size
Definition TreeMesh.cpp:158
uint32_t index
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
void expect(std::string_view message) const
Require success for a void operation.
Definition Result.h:582
Move-only operation result carrying either a value or Status.
Definition Result.h:176
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:185
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
The canonical owning dynamic value used by data-facing protocols.
Definition Value.h:31
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
Definition Value.cpp:177
std::map< std::string, Value > Object
Definition Value.h:34
std::vector< Value > Array
Definition Value.h:33
const T * getIf() const noexcept
Return a typed pointer, or nullptr when the kind differs.
Definition Value.h:209
Value * find(const std::string &key) noexcept
Return an object member, or nullptr when absent.
Definition Value.cpp:244
static Document parse(const std::string &text, std::string *error=nullptr)
Parse.
Definition Json.cpp:623
EVENGINE_API_FOUNDATION public API.
Definition Json.h:39
Format-neutral, editable top-down level model.
static const Object & extensions(const LevelDocument &document)
static Object & extensions(LevelDocument &document)
std::string getFormatId(int index) const
Returns the format id.
eve::Result< std::unique_ptr< LevelDocument > > load(const std::string &path, const std::string &format={}) const
Loads .
eve::Result< void > registerFormat(std::unique_ptr< LevelFormat > format)
Registers format.
LevelFormatRegistry()
Level format registry.
eve::Result< void > save(const std::string &path, const LevelDocument &level, const std::string &format={}) const
Encode then atomically replace a file; failures preserve an existing destination.
std::string detect(const std::string &path, const std::string &text) const
Detect.
eve::Result< std::string > encode(const std::string &format, const LevelDocument &level) const
Encode.
eve::Result< std::unique_ptr< LevelDocument > > decode(const std::string &format, const std::string &text) const
Decode.
StateValue objects
Definition Snapshot.cpp:110
Result< T > fail(std::string message, DiagnosticCode code=DiagnosticCode::InvalidArgument)
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:27
void keys(const Value &value, std::initializer_list< const char * > names)
Result< std::string > stringify(const eve::Value &value)
Serialize the canonical owning Value as deterministic compact JSON.
Definition Json.cpp:605
Build metadata (engine git commit, build time, third-party version).
Definition Build.cpp:16
DiagnosticCode
Stable machine-readable diagnostic codes.
Definition Diagnostic.h:47
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
enum EVENGINE_API_FOUNDATION Array
OT_ARRAY (editable via Runtime array APIs / ReflectedPropertyModel).
Definition Runtime.h:120