载入中...
搜索中...
未找到
RoadRecipeNetwork.cpp
浏览该文件的文档.
28 return RoadNetwork::makeScene(params.getString("scene", "straight"), params.getFloat("span", 36.f),
38 Diagnostic::error(DiagnosticCode::InvalidArgument, "roadType must be highway or railway", "roadType"));
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.cpp:21
const T & value() const &
Borrow the value from a const lvalue after checking success.
Definition Result.h:339
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:286
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Result< Value > fromJson(std::string_view json)
Parse one strict JSON value into an owning Value.
Definition Value.cpp:177
Owning directed road graph with lane connectivity.
Definition RoadNetwork.h:19
static Result< RoadNetwork > makeScene(const std::string &scene, float span=36.f, float bridgeHeight=6.f, int lanes=2, std::uint32_t seed=1)
Dispatch a named debug/demo scene.
Definition RoadNetworkRecipes.cpp:394
Definition TerrainWorldWorkspace.h:12
Result< eve::Value > captureRoadNetwork(const RoadNetwork &network)
Capture validated, owning author data using the editor-compatible roadNetwork schema v1....
Definition RoadNetworkCodec.cpp:38
Result< RoadNetwork > restoreRoadNetwork(const eve::Value &snapshot)
Decode schema v1 privately; unknown fields are ignored and unsupported versions rejected.
Definition RoadNetworkCodec.cpp:70
EVENGINE_API_DOMAINS Result< void > setRoadRecipeNetwork(Params ¶ms, const RoadNetwork &network)
Store canonical validated author data in the standard recipe's networkSnapshot parameter....
Definition RoadRecipeNetwork.cpp:5
EVENGINE_API_DOMAINS Result< RoadNetwork > resolveRoadRecipeNetwork(const Params ¶ms)
Resolve the recipe's author snapshot, or its procedural scene when no snapshot was supplied.
Definition RoadRecipeNetwork.cpp:16
Result< void > applyRailwayRoadType(RoadNetwork &network, int tracks)
Rewrite every edge to a railway style while preserving bridge/tunnel intervals.
Definition RoadRailway.cpp:121
@ InvalidArgument