Skip to main content

Placement

Enum Placement 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for Placement

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Placement

Source§

impl Debug for Placement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Placement

Source§

impl PartialEq for Placement

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Placement

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.