Skip to main content

CExpr

Enum CExpr 

Source
pub enum CExpr {
Show 20 variants Lit(Val), Var(u16), Local(u16), Bind(u16), Named(AssetId), SelfEntity, Dt, Elapsed, Position(Box<CExpr>), Distance(Box<CExpr>, Box<CExpr>), Alive(Box<CExpr>), First(u16), Count(u16), Arith(Arith, Box<CExpr>, Box<CExpr>), Normalize(Box<CExpr>), Compare(Cmp, Box<CExpr>, Box<CExpr>), All(Vec<CExpr>), Any(Vec<CExpr>), Not(Box<CExpr>), Never,
}
Expand description

A slot-resolved expression.

Variants§

§

Lit(Val)

A constant.

§

Var(u16)

A world variable, by slot.

§

Local(u16)

One of the behavior’s locals, by slot.

§

Bind(u16)

A binding introduced by let or for_each, by slot.

§

Named(AssetId)

The entity a name resolves to.

§

SelfEntity

The entity this run is scoped to.

§

Dt

Seconds this tick advances.

§

Elapsed

Seconds of simulated time so far.

§

Position(Box<CExpr>)

An entity’s world position.

§

Distance(Box<CExpr>, Box<CExpr>)

Distance between two entities.

§

Alive(Box<CExpr>)

Whether an entity still exists.

§

First(u16)

The first entity a declared query selects, by slot.

§

Count(u16)

How many entities a declared query selects, by slot.

§

Arith(Arith, Box<CExpr>, Box<CExpr>)

Two numbers combined.

§

Normalize(Box<CExpr>)

A vector scaled to unit length.

§

Compare(Cmp, Box<CExpr>, Box<CExpr>)

Two values compared.

§

All(Vec<CExpr>)

True when every operand is true.

§

Any(Vec<CExpr>)

True when any operand is true.

§

Not(Box<CExpr>)

Logical negation.

§

Never

An expression the checker should have rejected. Evaluates to nothing.

Trait Implementations§

Source§

impl Debug for CExpr

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for CExpr

§

impl RefUnwindSafe for CExpr

§

impl Send for CExpr

§

impl Sync for CExpr

§

impl Unpin for CExpr

§

impl UnsafeUnpin for CExpr

§

impl UnwindSafe for CExpr

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.