pub enum Placement {
Prefabs,
SitePlan,
NoMap,
}Expand description
The one thing a campaign hands its space to.
Variants§
Prefabs
Stage-1 areas[] seats prefab pieces. Anchor names come from prefab
metadata; area ids are the ones the world document declares.
SitePlan
A site-plan.json owns the space. There is exactly one area
(crate::siteplan::SITE_AREA) and the anchor names are the ones the
derivation places (crate::siteplan::synthesized_anchors) — the
spawn/node-/seam-/unlock- set the graph’s own shape dictates,
plus every stations[] name its nodes declare (spec-0052). The station
half is why the remedy tells the author they may declare the name as
well as correct it: it is the only anchor name in this engine an author
writes by hand, so an unresolved one is as likely a missing declaration
as a typo.
NoMap
Neither. areas[] is empty and there is no site plan, so the campaign
declares no place and nothing places an anchor: every area reference and
every anchor reference in it is unresolvable, whatever it says.
This is a real authoring state and it is the one the old messages served
worst — a story layer written before its map. Refusing it is correct; the
only question is what the author is told to do about it, and the answer
is not “declare it in world.areas”, because that names one of the two
halves of a choice the author has not made yet and hides the other.
Implementations§
Source§impl Placement
impl Placement
Sourcepub fn of(c: &Campaign) -> Self
pub fn of(c: &Campaign) -> Self
Ask the campaign, once.
A site plan wins when both are present, because that is what the
resolution does: [crate::validate::AnchorProviders] and all three area
sets admit the derived vocabulary whenever a plan is on disk, whatever
areas[] says. Such a campaign is refused by DW0839, whose message is
the one that matters there — this one is describing the set the resolver
actually used.
Sourcepub fn area_remedy(self) -> &'static str
pub fn area_remedy(self) -> &'static str
What to write instead of an area id that does not resolve.
The Prefabs arm is the sentence every area refusal has always carried,
unchanged, so a prefab campaign reads exactly what it read before.
Sourcepub fn anchor_remedy(self, prefab: &str) -> &str
pub fn anchor_remedy(self, prefab: &str) -> &str
What to write instead of an anchor name that does not resolve.
prefab is the sentence this call site has always printed for a prefab
campaign, passed in rather than centralised because it is genuinely
per-verb — a trap is told about anchor/trap markers, a trigger about
its at. It is returned verbatim, so a prefab campaign’s refusal is
byte-identical to the one it printed before this module existed.
It is dropped on the other two arms rather than appended, and that is the whole point: every one of those sentences prescribes a prefab operation, and a derived map has no prefab for the author to reach.
Sourcepub fn lighting_field(self) -> &'static str
pub fn lighting_field(self) -> &'static str
Where this campaign writes a lighting declaration.
Not a sentence but a field name, because that is the whole of what moves
between the two kinds: a site plan carries ONE lighting, applied to
every enclosed box, and a prefab campaign carries one per areas[]
entry. The prose around it — which fixture, what min_light is for, what
not to do about it — is the same either way and stays where it is
written, which is also where tools/ci/check-diagnostic-messages.py reads
it.
NoMap answers with the areas[] field: such a campaign has no area for
the light pass to walk, so this arm is reached only by a caller asking in
the abstract, and areas[] is the surface it would be writing.
Returned BARE, with no stage qualifier, because two callers need two
different qualifiers of one name — DW0210 says “declare …” and DW0211
says “Fix in …” — and a second accessor for the second phrasing would be
the duplication this module exists to remove.
Sourcepub fn has_area_mitigation(self) -> bool
pub fn has_area_mitigation(self) -> bool
Whether this campaign has the per-area mitigation surface at all.
It lives on an areas[] entry, and a site-plan campaign is required to
declare an empty areas list (DW0839), so it has none. That is a
capability a derived map does not have rather than a wording question: a
darkness refusal offers the option only where it exists, because offering
it anywhere else is a prescription the campaign is refused for carrying
out.