载入中...
搜索中...
未找到
SpellFragmentCompiler.cpp
浏览该文件的文档.
2#include "common/ValueRead.h"
4
5#include "common/Diagnostic.h"
6#include "common/Time.h"
8
9#include <cmath>
10#include <cstdint>
11#include <limits>
12#include <string>
13#include <string_view>
14#include <utility>
15#include <vector>
16
17namespace eve::weapon {
18namespace {
19
20const Value* field(const Value::Object& object, const char* name) {
21 const auto it = object.find(name);
22 return it == object.end() ? nullptr : &it->second;
23}
24
25bool readString(const Value::Object& object, const char* name, std::string& output) {
26 auto parsed = eve::readStringMember(object, name);
27 if (!parsed) return false;
28 output = std::move(parsed.value());
29 return true;
30}
31
32Result<std::optional<double>> optionalDouble(const Value::Object& object, const char* name, std::string_view path) {
33 return detail::readOptionalDouble(object, name, path, "weapon.spell.fragments");
34}
35
36Result<std::optional<int>> optionalInt(const Value::Object& object, const char* name, std::string_view path) {
37 return detail::readOptionalInt(object, name, path, "weapon.spell.fragments");
38}
39
40enum class ArithKind : std::uint8_t { Add, Multiply };
41
42struct ArithOp {
43 ArithKind kind = ArithKind::Add;
44 double value = 0.0;
45};
46
47[[nodiscard]] double applyArith(double base, const std::vector<ArithOp>& ops) {
48 double result = base;
49 for (const auto& op : ops) {
50 if (op.kind == ArithKind::Add)
51 result += op.value;
52 else
53 result *= op.value;
54 }
55 return result;
56}
57
58struct ModifierStack {
59 std::vector<ArithOp> speedOps;
60 std::vector<ArithOp> damageOps;
61 std::vector<ArithOp> lifetimeOps;
62 double gravity = 0.0;
63 double homing = 0.0;
64 double accelerate = 0.0;
65 double swayAmplitude = 0.0;
66 double swayFrequency = 0.0;
67 double helixAmplitude = 0.0;
68 double helixFrequency = 0.0;
69 int pierce = 0;
70 int bounce = 0;
71 double restitution = 1.0;
72 double splash = 0.0;
73 double fuse = 0.0;
74 std::string element;
75 std::string damageType;
76 std::optional<CarrierVolleySpec> volley;
77};
78
79Result<void> applyModifier(ModifierStack& stack, const Value::Object& object, std::string_view kind,
80 std::string path) {
81 if (kind == "homing") {
82 auto turnRate = optionalDouble(object, "turnRate", path + ".turnRate");
83 if (!turnRate.ok()) return Result<void>::failure(turnRate.status());
84 auto alt = optionalDouble(object, "maxTurnRateDegrees", path + ".maxTurnRateDegrees");
85 if (!alt.ok()) return Result<void>::failure(alt.status());
86 const double turn = turnRate.value().value_or(alt.value().value_or(90.0));
87 if (!(turn > 0.0)) return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("homing turnRate must be positive"), std::string(path), {},
88 "weapon.spell.fragments"));
89 stack.homing = turn;
90 return Result<void>::success();
91 }
92 if (kind == "gravity") {
93 auto gravity = optionalDouble(object, "gravity", path + ".gravity");
94 if (!gravity.ok()) return Result<void>::failure(gravity.status());
95 const double value = gravity.value().value_or(9.8);
96 if (value < 0.0) return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("gravity must be non-negative"), std::string(path), {},
97 "weapon.spell.fragments"));
98 stack.gravity = value;
99 return Result<void>::success();
100 }
101 if (kind == "accelerate") {
102 auto acceleration = optionalDouble(object, "acceleration", path + ".acceleration");
103 if (!acceleration.ok()) return Result<void>::failure(acceleration.status());
104 if (!acceleration.value().has_value() || *acceleration.value() < 0.0)
105 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("accelerate requires non-negative acceleration"), std::string(path), {},
106 "weapon.spell.fragments"));
107 stack.accelerate = *acceleration.value();
108 return Result<void>::success();
109 }
110 if (kind == "sway" || kind == "helix") {
111 auto amplitude = optionalDouble(object, "amplitude", path + ".amplitude");
112 if (!amplitude.ok()) return Result<void>::failure(amplitude.status());
113 auto altAmp = optionalDouble(object, "curveAmplitude", path + ".curveAmplitude");
114 if (!altAmp.ok()) return Result<void>::failure(altAmp.status());
115 const auto amp = amplitude.value().has_value() ? amplitude.value() : altAmp.value();
116 if (!amp.has_value() || *amp < 0.0)
117 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("curve fragment requires non-negative amplitude"), std::string(path), {},
118 "weapon.spell.fragments"));
119 auto frequency = optionalDouble(object, "frequency", path + ".frequency");
120 if (!frequency.ok()) return Result<void>::failure(frequency.status());
121 auto altFreq = optionalDouble(object, "curveFrequencyHz", path + ".curveFrequencyHz");
122 if (!altFreq.ok()) return Result<void>::failure(altFreq.status());
123 const double freq = frequency.value().value_or(altFreq.value().value_or(2.0));
124 if (!(freq > 0.0)) return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("curve frequency must be positive"), std::string(path), {},
125 "weapon.spell.fragments"));
126 if (kind == "sway") {
127 stack.swayAmplitude = *amp;
128 stack.swayFrequency = freq;
129 } else {
130 stack.helixAmplitude = *amp;
131 stack.helixFrequency = freq;
132 }
133 return Result<void>::success();
134 }
135 if (kind == "pierce" || kind == "bounce") {
136 auto count = optionalInt(object, "count", path + ".count");
137 if (!count.ok()) return Result<void>::failure(count.status());
138 const int value = count.value().value_or(1);
139 if (value <= 0) return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("count must be positive"), std::string(path), {},
140 "weapon.spell.fragments"));
141 if (kind == "pierce") {
142 stack.pierce = value;
143 } else {
144 stack.bounce = value;
145 auto restitution = optionalDouble(object, "restitution", path + ".restitution");
146 if (!restitution.ok()) return Result<void>::failure(restitution.status());
147 if (restitution.value().has_value()) {
148 if (*restitution.value() < 0.0)
149 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("restitution must be non-negative"), std::string(path), {},
150 "weapon.spell.fragments"));
151 stack.restitution = *restitution.value();
152 }
153 }
154 return Result<void>::success();
155 }
156 if (kind == "damage" || kind == "speed" || kind == "lifetime") {
157 auto add = optionalDouble(object, "add", path + ".add");
158 if (!add.ok()) return Result<void>::failure(add.status());
159 auto multiply = optionalDouble(object, "multiply", path + ".multiply");
160 if (!multiply.ok()) return Result<void>::failure(multiply.status());
161 if (!add.value().has_value() && !multiply.value().has_value())
162 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("modifier requires add and/or multiply"), std::string(path), {},
163 "weapon.spell.fragments"));
164 auto& ops = (kind == "damage") ? stack.damageOps : (kind == "speed") ? stack.speedOps : stack.lifetimeOps;
165 // Preserve fragment order: add keys then multiply keys as written is ambiguous in objects,
166 // so apply add before multiply when both are present in one fragment; separate fragments
167 // retain left-to-right order across the sequence.
168 if (add.value().has_value()) ops.push_back({ArithKind::Add, *add.value()});
169 if (multiply.value().has_value()) ops.push_back({ArithKind::Multiply, *multiply.value()});
170 return Result<void>::success();
171 }
172 if (kind == "element") {
173 if (!readString(object, "value", stack.element) && !readString(object, "element", stack.element))
174 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("element requires value"), std::string(path), {},
175 "weapon.spell.fragments"));
176 return Result<void>::success();
177 }
178 if (kind == "damageType") {
179 if (!readString(object, "value", stack.damageType) && !readString(object, "damageType", stack.damageType))
180 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("damageType requires value"), std::string(path), {},
181 "weapon.spell.fragments"));
182 return Result<void>::success();
183 }
184 if (kind == "splash") {
185 auto radius = optionalDouble(object, "radius", path + ".radius");
186 if (!radius.ok()) return Result<void>::failure(radius.status());
187 auto alt = optionalDouble(object, "splash", path + ".splash");
188 if (!alt.ok()) return Result<void>::failure(alt.status());
189 const auto value = radius.value().has_value() ? radius.value() : alt.value();
190 if (!value.has_value() || !(*value > 0.0))
191 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("splash requires positive radius"), std::string(path), {},
192 "weapon.spell.fragments"));
193 stack.splash = *value;
194 return Result<void>::success();
195 }
196 if (kind == "fuse") {
197 auto seconds = optionalDouble(object, "seconds", path + ".seconds");
198 if (!seconds.ok()) return Result<void>::failure(seconds.status());
199 auto alt = optionalDouble(object, "fuse", path + ".fuse");
200 if (!alt.ok()) return Result<void>::failure(alt.status());
201 const auto value = seconds.value().has_value() ? seconds.value() : alt.value();
202 if (!value.has_value() || !(*value > 0.0))
203 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("fuse requires positive seconds"), std::string(path), {},
204 "weapon.spell.fragments"));
205 stack.fuse = *value;
206 auto splash = optionalDouble(object, "splash", path + ".splash");
207 if (!splash.ok()) return Result<void>::failure(splash.status());
208 auto splashAlt = optionalDouble(object, "radius", path + ".radius");
209 if (!splashAlt.ok()) return Result<void>::failure(splashAlt.status());
210 if (splash.value().has_value())
211 stack.splash = *splash.value();
212 else if (splashAlt.value().has_value())
213 stack.splash = *splashAlt.value();
214 return Result<void>::success();
215 }
216 if (kind == "fan" || kind == "multicast" || kind == "ring") {
217 CarrierVolleySpec volley;
219 auto count = optionalInt(object, "count", path + ".count");
220 if (!count.ok()) return Result<void>::failure(count.status());
221 if (!count.value().has_value() || *count.value() < 1)
222 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("volley requires positive count"), std::string(path), {},
223 "weapon.spell.fragments"));
224 volley.count = *count.value();
225 auto spread = optionalDouble(object, "spread", path + ".spread");
226 if (!spread.ok()) return Result<void>::failure(spread.status());
227 auto spreadAlt = optionalDouble(object, "spreadDegrees", path + ".spreadDegrees");
228 if (!spreadAlt.ok()) return Result<void>::failure(spreadAlt.status());
229 volley.spreadDegrees = spread.value().value_or(spreadAlt.value().value_or(0.0));
230 stack.volley = volley;
231 return Result<void>::success();
232 }
233 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Unknown fragment kind"), std::string(path + ".kind"), {},
234 "weapon.spell.fragments"));
235}
236
237Result<CarrierRecipe> buildProjectile(const Value::Object& object, const ModifierStack& stack, std::string path) {
238 if (field(object, "triggers") || field(object, "impacts") || field(object, "motionOps") ||
239 (field(object, "motion") && field(object, "motion")->isArray())) {
240 return Result<CarrierRecipe>::failure(Diagnostic::error(DiagnosticCode::Unsupported, std::string("Projectile fragments must use preset fields, not full-form motion/triggers/impacts"), std::string(path), {},
241 "weapon.spell.fragments"));
242 }
243
244 std::string id;
245 if (!readString(object, "id", id) || id.empty())
246 return Result<CarrierRecipe>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("projectile requires id"), std::string(path + ".id"), {},
247 "weapon.spell.fragments"));
248
249 auto speedField = optionalDouble(object, "speed", path + ".speed");
250 if (!speedField.ok()) return Result<CarrierRecipe>::failure(speedField.status());
251 double speed = applyArith(speedField.value().value_or(10.0), stack.speedOps);
252 if (!(speed > 0.0) || !std::isfinite(speed))
253 return Result<CarrierRecipe>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("projectile speed must be positive"), std::string(path + ".speed"), {},
254 "weapon.spell.fragments"));
255
256 auto lifetimeField = optionalDouble(object, "lifetime", path + ".lifetime");
257 if (!lifetimeField.ok()) return Result<CarrierRecipe>::failure(lifetimeField.status());
258 double lifetime = applyArith(lifetimeField.value().value_or(2.0), stack.lifetimeOps);
259 if (!(lifetime > 0.0) || !std::isfinite(lifetime))
260 return Result<CarrierRecipe>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("projectile lifetime must be positive"), std::string(path + ".lifetime"), {},
261 "weapon.spell.fragments"));
262
263 auto damageField = optionalDouble(object, "damage", path + ".damage");
264 if (!damageField.ok()) return Result<CarrierRecipe>::failure(damageField.status());
265 double damage = applyArith(damageField.value().value_or(0.0), stack.damageOps);
266
267 ModifierStack merged = stack;
268 auto seedDouble = [&](const char* name, double& dest) -> Result<void> {
269 auto value = optionalDouble(object, name, std::string(path) + "." + name);
270 if (!value.ok()) return Result<void>::failure(value.status());
271 if (dest <= 0.0 && value.value().has_value()) dest = *value.value();
272 return Result<void>::success();
273 };
274 if (auto seeded = seedDouble("homing", merged.homing); !seeded)
275 return Result<CarrierRecipe>::failure(seeded.status());
276 if (auto seeded = seedDouble("maxTurnRateDegrees", merged.homing); !seeded)
277 return Result<CarrierRecipe>::failure(seeded.status());
278 if (auto seeded = seedDouble("gravity", merged.gravity); !seeded)
279 return Result<CarrierRecipe>::failure(seeded.status());
280 if (auto seeded = seedDouble("accelerate", merged.accelerate); !seeded)
281 return Result<CarrierRecipe>::failure(seeded.status());
282
283 std::string motionPreset;
284 (void)readString(object, "motion", motionPreset);
285 if (motionPreset == "homing" && merged.homing <= 0.0) merged.homing = 90.0;
286 if (motionPreset == "ballistic" && merged.gravity <= 0.0) merged.gravity = 9.8;
287
288 auto pierceField = optionalInt(object, "pierce", path + ".pierce");
289 if (!pierceField.ok()) return Result<CarrierRecipe>::failure(pierceField.status());
290 if (merged.pierce <= 0 && pierceField.value().has_value()) merged.pierce = *pierceField.value();
291 auto bounceField = optionalInt(object, "bounce", path + ".bounce");
292 if (!bounceField.ok()) return Result<CarrierRecipe>::failure(bounceField.status());
293 if (merged.bounce <= 0 && bounceField.value().has_value()) merged.bounce = *bounceField.value();
294
295 Value::Object preset;
296 preset["id"] = Value(id);
297 preset["speed"] = Value(speed);
298 preset["lifetime"] = Value(lifetime);
299 preset["damage"] = Value(damage);
300 if (merged.gravity > 0.0) preset["gravity"] = Value(merged.gravity);
301 if (merged.homing > 0.0) preset["homing"] = Value(merged.homing);
302 if (merged.accelerate > 0.0) preset["accelerate"] = Value(merged.accelerate);
303 if (merged.pierce > 0) preset["pierce"] = Value(static_cast<std::int64_t>(merged.pierce));
304 if (merged.bounce > 0) preset["bounce"] = Value(static_cast<std::int64_t>(merged.bounce));
305 if (merged.fuse > 0.0) preset["fuse"] = Value(merged.fuse);
306 if (merged.splash > 0.0) preset["splash"] = Value(merged.splash);
307
308 std::string element;
309 std::string damageType;
310 (void)readString(object, "element", element);
311 (void)readString(object, "damageType", damageType);
312 if (!merged.element.empty()) element = merged.element;
313 if (!merged.damageType.empty()) damageType = merged.damageType;
314 if (!element.empty()) preset["element"] = Value(element);
315 if (!damageType.empty()) preset["damageType"] = Value(damageType);
316
317 auto recipe = decodeCarrierRecipe(Value(std::move(preset)));
318 if (!recipe.ok()) return recipe;
319 CarrierRecipe built = std::move(recipe).takeValue();
320
321 // Preserve preset motion from decode; only inject curve ops that presets cannot express.
322 if (merged.swayAmplitude > 0.0 || merged.helixAmplitude > 0.0) {
323 std::vector<CarrierMotionOp> motion = built.motionOps;
324 // Insert curve ops before the final IntegrateLinear.
325 if (!motion.empty() && motion.back().kind == CarrierMotionOpKind::IntegrateLinear) motion.pop_back();
326 if (merged.swayAmplitude > 0.0) {
327 CarrierMotionOp op;
329 op.curveAmplitude = merged.swayAmplitude;
330 op.curveFrequencyHz = merged.swayFrequency > 0.0 ? merged.swayFrequency : 2.0;
331 motion.push_back(op);
332 }
333 if (merged.helixAmplitude > 0.0) {
334 CarrierMotionOp op;
336 op.curveAmplitude = merged.helixAmplitude;
337 op.curveFrequencyHz = merged.helixFrequency > 0.0 ? merged.helixFrequency : 2.0;
338 motion.push_back(op);
339 }
340 motion.push_back({CarrierMotionOpKind::IntegrateLinear});
341 built.motionOps = std::move(motion);
342 }
343
344 if (merged.bounce > 0) {
345 for (auto& impact : built.impacts) {
346 if (impact.kind == CarrierImpactKind::Bounce) impact.restitution = merged.restitution;
347 }
348 }
349
350 auto valid = built.validate();
351 if (!valid) return Result<CarrierRecipe>::failure(valid.status());
352 return Result<CarrierRecipe>::success(std::move(built));
353}
354
355} // namespace
356
358 if (!fragments.isArray())
359 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Fragments must be an array"), std::string(""), {},
360 "weapon.spell.fragments"));
361 if (fragments.arraySize() == 0)
362 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Fragments must not be empty"), std::string(""), {},
363 "weapon.spell.fragments"));
364
365 ModifierStack stack;
366 std::optional<CarrierRecipe> recipe;
367 for (std::size_t i = 0; i < fragments.arraySize(); ++i) {
368 const std::string path = "[" + std::to_string(i) + "]";
369 const auto* object = fragments.at(i).getIf<Value::Object>();
370 if (!object)
371 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Fragment must be an object"), std::string(path), {},
372 "weapon.spell.fragments"));
373 std::string kind;
374 if (!readString(*object, "kind", kind) || kind.empty())
375 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Fragment requires kind"), std::string(path + ".kind"), {},
376 "weapon.spell.fragments"));
377
378 if (kind == "projectile" || kind == "bolt" || kind == "grenade" || kind == "missile") {
379 if (recipe.has_value())
380 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Only one projectile fragment is supported per cast"), std::string(path), {},
381 "weapon.spell.fragments"));
382 auto built = buildProjectile(*object, stack, path);
383 if (!built.ok()) return Result<SpellCastPlan>::failure(built.status());
384 recipe = std::move(built).takeValue();
385 continue;
386 }
387
388 if (recipe.has_value())
389 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Modifiers must appear before the projectile fragment"), std::string(path), {},
390 "weapon.spell.fragments"));
391
392 auto applied = applyModifier(stack, *object, kind, path);
393 if (!applied) return Result<SpellCastPlan>::failure(applied.status());
394 }
395
396 if (!recipe.has_value())
397 return Result<SpellCastPlan>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, std::string("Fragment sequence requires one projectile fragment"), std::string(""), {},
398 "weapon.spell.fragments"));
399
400 SpellCastPlan plan;
401 plan.recipe = std::move(*recipe);
402 plan.volley = stack.volley;
403 return Result<SpellCastPlan>::success(std::move(plan));
404}
405
407 auto parsed = Value::fromJson(json);
408 if (!parsed.ok()) return Result<SpellCastPlan>::failure(parsed.status());
409 return compileSpellFragments(parsed.value());
410}
411
412} // namespace eve::weapon
std::string output
Decode/encode CombatCarrier recipes from canonical eve::Value trees.
bool applied
Stable, structured diagnostics shared by engine modules.
std::string name
Definition ECS.cpp:154
ScriptForceVector gravity
ScriptForceVector acceleration
std::weak_ptr< const void > lifetime
std::string id
Poco::JSON::Object::Ptr result
bool valid
double radius
Definition MeleeHit.cpp:42
BakeRecipe recipe
std::string path
Definition PlayHost.cpp:111
Object::Ptr value
LinkOps ops
std::string kind
std::vector< ArithOp > speedOps
std::string damageType
double helixAmplitude
std::vector< ArithOp > lifetimeOps
std::string element
double splash
double restitution
double swayFrequency
double helixFrequency
std::optional< CarrierVolleySpec > volley
double accelerate
double fuse
double swayAmplitude
double homing
std::vector< ArithOp > damageOps
Compile Noita-style spell/modifier fragment sequences into carrier recipes.
int count
TacticalUnit::TurnResources turn
Common time values and an injectable deterministic simulation clock.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
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
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
bool isArray() const noexcept
Return true when this value is an array.
Definition Value.h:108
std::size_t arraySize() const
Return the number of array elements.
Definition Value.cpp:220
const T * getIf() const noexcept
Return a typed pointer, or nullptr when the kind differs.
Definition Value.h:209
Value & at(std::size_t index)
Return a bounds-checked array element.
Definition Value.cpp:226
const Value * field(const Value &value, const char *key)
Borrow an optional object field.
std::variant< std::monostate, std::int64_t, double, std::string, bool > Value
Definition Database.h:27
bool readString(const eve::Value::Object &object, const char *name, std::string &output)
ForceVector add(ForceVector a, ForceVector b)
Definition ForceMath.h:13
Result< std::optional< double > > readOptionalDouble(const Value::Object &object, std::string_view name, std::string_view path, std::string_view source)
Decode an optional finite number for the weapon codecs.
Definition NumericRead.h:24
Result< std::optional< int > > readOptionalInt(const Value::Object &object, std::string_view name, std::string_view path, std::string_view source)
Decode an optional native int, also accepting integral finite Doubles, for the weapon codecs.
Definition NumericRead.h:49
载具模块入口(eve.Vehicle):定义注册 / 实体工厂 / RTS 命令 / 帧调度。 设计文档:docs/dev/通用载具系统设计.md
Result< CarrierRecipe > decodeCarrierRecipe(const Value &value)
Decode one CarrierRecipe from an owning Value object.
Result< SpellCastPlan > compileSpellFragmentsJson(const std::string &json)
Compile a JSON array string into one cast plan.
Result< SpellCastPlan > compileSpellFragments(const Value &fragments)
Compile a fragment array Value into one cast plan.
CarrierVolleyPattern
Multi-projectile aim pattern for one salvo.
Result< std::string > readStringMember(const Value::Object &object, std::string_view name)
Read a required string field, including an empty string, as an owning value.
Definition Value.cpp:25
One compiled cast unit ready to register and spawn.