pub enum CameraSubject {
Anchor(Mark),
Npc(NpcSubject),
Actor(ActorSubject),
}Expand description
A styled shot’s subject (DSL v0.6): the world thing the shot frames — a
prefab anchor point, a stage-2 NPC, or a stage-5 actor — plus an integer
block offset. For npc/actor subjects the aim point is the entity’s cell
plus one block up (torso height, so a close shot does not frame feet)
before offset is applied; an anchor subject aims at the block centre
exactly like a [CameraTarget].
Each variant’s payload is a named struct carrying deny_unknown_fields
— serde has no variant-level deny_unknown_fields, so an untagged
enum with inline struct variants silently ignores any key it does not
recognise: {"npc": …, "ofset": [0,1,0]} would deserialize happily with the
offset dropped, and {"anchor": …, "npc": …} would quietly match Anchor
and discard the NPC. Lifting each variant into its own type keeps the repo-wide
deny-unknown rule for both serde and the published JSON Schema
(additionalProperties: false): a mistyped shot subject fails the schema
instead of rendering a shot pointed somewhere the author never asked for.
Variants§
Anchor(Mark)
A fixed world point: prefab anchor + offset.
Npc(NpcSubject)
A stage-2 NPC — moving if a move-npc for it runs in the same effect
group / sequence, else static at its declared (or spawn) anchor.
Actor(ActorSubject)
A stage-5 actor — moving if a move-actor for it runs in the same
effect group / sequence, else static at its declared anchor.
Implementations§
Trait Implementations§
Source§impl Clone for CameraSubject
impl Clone for CameraSubject
Source§impl Debug for CameraSubject
impl Debug for CameraSubject
Source§impl<'de> Deserialize<'de> for CameraSubject
impl<'de> Deserialize<'de> for CameraSubject
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>,
Source§impl JsonSchema for CameraSubject
impl JsonSchema for CameraSubject
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