pub struct FrameStepper {
pub acc_minutes: f64,
/* private fields */
}Expand description
A host’s frame-to-steps state. Keep one per game and call
advance once per display frame.
Fields§
§acc_minutes: f64The game minutes owed and not yet stepped, carried to the next frame.
Implementations§
Source§impl FrameStepper
impl FrameStepper
Sourcepub fn advance<S: StepSim>(
&mut self,
sim: &mut S,
dt_ms: f64,
minutes_per_second: f64,
steady_clock: bool,
step: bool,
) -> u32
pub fn advance<S: StepSim>( &mut self, sim: &mut S, dt_ms: f64, minutes_per_second: f64, steady_clock: bool, step: bool, ) -> u32
Owes this frame’s game minutes and steps what is owed. dt_ms is the
frame’s real length and minutes_per_second the game speed. Without
steady_clock, time follows the canon day curve, whose pace changes
through the day as the 1994 game’s clock does; with it, the rate is
flat. The carry never exceeds
MAX_CATCHUP_MINUTES, and no frame runs more than
MAX_STEPS_PER_FRAME steps. With step false the minutes are owed
but not stepped (a host still busy with its last batch). Returns the
steps run.
Trait Implementations§
Source§impl Clone for FrameStepper
impl Clone for FrameStepper
Source§fn clone(&self) -> FrameStepper
fn clone(&self) -> FrameStepper
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FrameStepper
impl Debug for FrameStepper
Source§impl Default for FrameStepper
impl Default for FrameStepper
Source§fn default() -> FrameStepper
fn default() -> FrameStepper
Returns the “default value” for a type. Read more
Source§impl PartialEq for FrameStepper
impl PartialEq for FrameStepper
Source§fn eq(&self, other: &FrameStepper) -> bool
fn eq(&self, other: &FrameStepper) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FrameStepper
Auto Trait Implementations§
impl Freeze for FrameStepper
impl RefUnwindSafe for FrameStepper
impl Send for FrameStepper
impl Sync for FrameStepper
impl Unpin for FrameStepper
impl UnsafeUnpin for FrameStepper
impl UnwindSafe for FrameStepper
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