Skip to main content

COp

Enum COp 

Source
pub enum COp {
Show 16 variants If { cond: CExpr, then: Vec<CNode>, otherwise: Vec<CNode>, }, ForEach { query: u16, bind: u16, body: Vec<CNode>, }, Let { bind: u16, value: CExpr, }, SetVar { slot: u16, value: CExpr, add: bool, }, SetLocal { slot: u16, value: CExpr, add: bool, }, SetTransform { entity: CExpr, position: Option<CExpr>, rotation_deg: Option<CExpr>, scale: Option<CExpr>, }, Spawn { template: AssetId, position: [f32; 3], rotation_deg: [f32; 3], scale: [f32; 3], lifetime: f32, bind: Option<u16>, }, Despawn(CExpr), Reparent { child: CExpr, parent: Option<CExpr>, }, Visible(CExpr, bool), Sound { clip: AudioClipHandle, kind: CueKind, volume: f32, }, Scene { scene: AssetId, transition: String, }, Screen(AssetId), Story(StoryPlayback), Save, Never,
}
Expand description

A slot-resolved node operation.

Variants§

§

If

Run one branch or the other.

Fields

§cond: CExpr

The tested condition.

§then: Vec<CNode>

Branch taken when the condition holds.

§otherwise: Vec<CNode>

Branch taken otherwise.

§

ForEach

Run the body once per entity a declared query selects.

Fields

§query: u16

The query’s slot.

§bind: u16

Binding slot the iterated entity lands in.

§body: Vec<CNode>

Nodes run per entity.

§

Let

Introduce a binding for the rest of the enclosing list.

Fields

§bind: u16

Binding slot to fill.

§value: CExpr

Value the binding takes.

§

SetVar

Write a world variable.

Fields

§slot: u16

The variable’s slot.

§value: CExpr

Value to write.

§add: bool

Add to the current value rather than replacing it.

§

SetLocal

Write one of the behavior’s locals.

Fields

§slot: u16

The local’s slot.

§value: CExpr

Value to write.

§add: bool

Add to the current value rather than replacing it.

§

SetTransform

Overwrite the named parts of an entity’s transform.

Fields

§entity: CExpr

The entity to move.

§position: Option<CExpr>

New position, when authored.

§rotation_deg: Option<CExpr>

New rotation in degrees, when authored.

§scale: Option<CExpr>

New scale, when authored.

§

Spawn

Request a copy of a template.

Fields

§template: AssetId

The template to copy.

§position: [f32; 3]

Where the copy starts.

§rotation_deg: [f32; 3]

The copy’s starting rotation, in degrees.

§scale: [f32; 3]

The copy’s starting scale.

§lifetime: f32

Seconds the copy lives, or zero for no limit.

§bind: Option<u16>

Binding slot the copy would land in, once it exists.

§

Despawn(CExpr)

Request an entity’s removal.

§

Reparent

Move an entity under another parent, or to the root.

Fields

§child: CExpr

The entity to move.

§parent: Option<CExpr>

Its new parent, or None for the root.

§

Visible(CExpr, bool)

Show or hide an entity.

§

Sound

Play an audio cue.

Fields

§clip: AudioClipHandle

The clip to play.

§kind: CueKind

How the cue is voiced.

§volume: f32

Playback volume.

§

Scene

Request a scene change.

Fields

§scene: AssetId

The scene to load.

§transition: String

The transition to play.

§

Screen(AssetId)

Request a screen change.

§

Story(StoryPlayback)

Drive story playback.

§

Save

Persist the world’s behavior state.

§

Never

A node the checker should have rejected. Does nothing.

Trait Implementations§

Source§

impl Debug for COp

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for COp

§

impl RefUnwindSafe for COp

§

impl Send for COp

§

impl Sync for COp

§

impl Unpin for COp

§

impl UnsafeUnpin for COp

§

impl UnwindSafe for COp

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> 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, 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, <T as TryFrom<U>>::Error>

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.