pub struct BodyWatch {
pub who: WatchWho,
pub within: NonZeroU32,
}Expand description
A still body that turns to face a player (spec-0101) — the declaration both body classes carry, as one type, because facing belongs to the body and not to the verb that first wanted it turned.
The run-time turn is execute … anchored eyes run rotate <body> facing entity <player> eyes (the body’s eyes to the player’s eyes), re-issued
from the root tick by one generated function (watch_tick): every tick a
player Self::who names stands within Self::within blocks of the
body’s feet, the body faces that player’s eyes with its own, body and head
together; with nobody in reach it keeps its last facing; while a move-npc /
move-actor walks it, the walk owns the yaw and the watch resumes on the tick
after the arrival.
Both fields are required: whom the figure watches and how far it sees are the creator’s, so neither has a default.
Fields§
§who: WatchWhoWhom the body faces: "nearest" (the nearest player), or
{ "class": "class/<id>" } (the nearest player wearing that class).
within: NonZeroU32How far the body sees, in whole blocks >= 1, measured as the game
measures an entity selector’s distance: from the body’s feet to the
player’s.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BodyWatch
impl<'de> Deserialize<'de> for BodyWatch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BodyWatch
Source§impl JsonSchema for BodyWatch
impl JsonSchema for BodyWatch
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more