pub struct Step<'a> {
pub player: &'a mut Player,
pub intent: &'a Intent,
pub terrain: &'a mut dyn Terrain,
pub tuning: &'a Tuning,
pub moves: &'a mut Moves,
pub events: &'a mut Vec<Event>,
pub others: &'a [Rect],
pub dt: f32,
pub scale: i32,
}Expand description
What an Ability gets to work with in one step.
Fields§
§player: &'a mut PlayerThe body.
intent: &'a IntentThis step’s input.
terrain: &'a mut dyn TerrainThe world around it; changes count from here on, in this step too.
tuning: &'a TuningThe movement feel.
moves: &'a mut MovesThe built-in moves allowed this step: clear some in Ability::before. Changes in
Ability::after come too late for this step (and the next starts from
Moves::ALL again).
events: &'a mut Vec<Event>This step’s events so far; push yours (Event::Custom).
others: &'a [Rect]The other characters’ bodies on the same terrain (a crate::Party), as the step
started for those yet to move and as they ended up for those already moved; empty
for a character on its own.
dt: f32The step’s length in seconds (super::DT).
scale: i32Pixels of the game’s terrain per unit (super::World::scale; 1 without a
Builder::scale). Everything in the step is in units, but a terrain of the game’s
own reached through find_mut answers in its
pixels: ask it with rect.scaled(s.scale).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Step<'a>
impl<'a> !Send for Step<'a>
impl<'a> !Sync for Step<'a>
impl<'a> !UnwindSafe for Step<'a>
impl<'a> Freeze for Step<'a>
impl<'a> Unpin for Step<'a>
impl<'a> UnsafeUnpin for Step<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.