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§fn clone(&self) -> SimulatedGameState
fn clone(&self) -> SimulatedGameState
Returns a duplicate of the value. Read more
1.0.0 · 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 SimulatedGameState
impl Debug for SimulatedGameState
Source§impl Default for SimulatedGameState
impl Default for SimulatedGameState
Source§fn default() -> SimulatedGameState
fn default() -> SimulatedGameState
Returns the “default value” for a type. Read more
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