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§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more