pub struct SimulatedGameState {
pub frame: u64,
pub player_x: f32,
pub player_y: f32,
pub health: i32,
pub score: i32,
pub entity_count: usize,
/* private fields */
}Expand description
A simulated game state for testing
Fields§
§frame: u64Current frame
player_x: f32Player X position
player_y: f32Player Y position
health: i32Player health
score: i32Current score
entity_count: usizeEntity count
Implementations§
Source§impl SimulatedGameState
impl SimulatedGameState
Sourcepub fn update(&mut self, inputs: &[InputEvent])
pub fn update(&mut self, inputs: &[InputEvent])
Update game state with inputs (deterministically)
Sourcepub fn compute_hash(&self) -> u64
pub fn compute_hash(&self) -> u64
Compute a hash of the current state
Trait Implementations§
Source§impl Clone for SimulatedGameState
impl Clone for SimulatedGameState
Source§impl Debug for SimulatedGameState
impl Debug for SimulatedGameState
Auto Trait Implementations§
impl Freeze for SimulatedGameState
impl RefUnwindSafe for SimulatedGameState
impl Send for SimulatedGameState
impl Sync for SimulatedGameState
impl Unpin for SimulatedGameState
impl UnsafeUnpin for SimulatedGameState
impl UnwindSafe for SimulatedGameState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().