pub trait GameState:
Clone
+ Send
+ 'static {
// Required methods
fn advance(&mut self, inputs: &FrameInput);
fn checksum(&self) -> u64;
// Provided method
fn snapshot_size_hint() -> usize { ... }
}Expand description
Implement this on your game state to enable rollback.
Required Methods§
Sourcefn advance(&mut self, inputs: &FrameInput)
fn advance(&mut self, inputs: &FrameInput)
Advance simulation by one frame using the given inputs.
Provided Methods§
Sourcefn snapshot_size_hint() -> usize
fn snapshot_size_hint() -> usize
Memory size hint for the snapshot (used for buffer sizing).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".