Skip to main content

BodyRef

Enum BodyRef 

Source
pub enum BodyRef<'a> {
    Npc(&'a Npc),
    Actor(&'a Actor),
}
Expand description

One object class that has a body the compiler stages: a declared position, a declared species, and a compiler-emitted route.

A sum type rather than a flattened tuple, so adding a body class is a compile error at every consumer until each one says what it does with it. The alternative — each rule walking the classes it happens to remember — is the defect class CLAUDE.md names: a hand-rolled walk that enumerated three of five effect roots.

Keyed to the object, not to the verb that first needed it. This type was introduced for BodyTraversal and read, for a while, as “one consumer of BodyTraversal” — which is why its only enumeration (body_traversal_sites) was filtered to bodies declaring a traversal, and why the second property a body carries, its NpcSkin, had no enumeration at all: the bake walked the stage-2 npc list by hand, and an actor’s skin was emitted into the summon, never baked into the pack, and never refused. A body’s properties belong to the body. body_sites is the unfiltered walk; a per-property enumeration is a filter over it, never a second walk.

Deliberately NOT a member: WaveMob. A wave mob has a body and a position, but it is driven by native vanilla AI, never by a compiler-emitted route, so the compiler makes no claim about the moves it makes and a locomotion declaration on it could change no verdict. It declares no skin either — the exclusion holds for both properties, and the schema says so (crates/dsl/tests/body_skin_sites.rs). It becomes a member the day the lane proof reasons about how its bodies move — and it joins here, through this same type, rather than through a field of its own.

Variants§

§

Npc(&'a Npc)

A stage-2 NPC, walked by move-npc.

§

Actor(&'a Actor)

A stage-5 scripted actor, walked by move-actor.

Implementations§

Source§

impl<'a> BodyRef<'a>

Source

pub const ALL_CLASSES: [&'static str; 2]

Every body class, by schema name. The closed set, stated once.

Source

pub fn stage(self) -> &'static str

The declaring stage’s wire name (npcs / quests) — also the stage whose dsl_version fences this body’s declaration.

Source

pub fn id(self) -> &'a str

The body’s declared id.

Source

pub fn declared_entity(self) -> &'a str

The entity id written on the body. Not necessarily the body that ships: a skin re-dresses it as a minecraft:mannequin, which is the compiler’s rule (nav::npc_body_entity) and stays there.

Source

pub fn traversal(self) -> Option<&'a BodyTraversal>

This body’s traversal declaration, if it carries one.

Source

pub fn skin(self) -> Option<&'a NpcSkin>

This body’s skin declaration, if it carries one.

A skinned body of either class ships as a minecraft:mannequin whose profile.texture resolves to delvewright:npc/<texture_id>, so either one owes the same skins/<texture_id>.png under the same refusal (DW0309). Answering it here is what stops the bake from being a property of one class.

Source

pub fn class(self) -> &'static str

This class’s name in the JSON Schema export (delvec schema --stage all).

The join between the closed Rust set and the schema, which is the only authority on which object classes declare what. body_skin_sites.rs compares the two.

Trait Implementations§

Source§

impl<'a> Clone for BodyRef<'a>

Source§

fn clone(&self) -> BodyRef<'a>

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<'a> Copy for BodyRef<'a>

Source§

impl<'a> Debug for BodyRef<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for BodyRef<'a>

§

impl<'a> RefUnwindSafe for BodyRef<'a>

§

impl<'a> Send for BodyRef<'a>

§

impl<'a> Sync for BodyRef<'a>

§

impl<'a> Unpin for BodyRef<'a>

§

impl<'a> UnsafeUnpin for BodyRef<'a>

§

impl<'a> UnwindSafe for BodyRef<'a>

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.