Trait backroll::SessionCallbacks[][src]

pub trait SessionCallbacks<T> where
    T: BackrollConfig
{ fn save_state(&mut self) -> (T::State, Option<u64>);
fn load_state(&mut self, state: &T::State);
fn advance_frame(&mut self, input: GameInput<T::Input>);
fn handle_event(&mut self, event: BackrollEvent); }

Required methods

fn save_state(&mut self) -> (T::State, Option<u64>)[src]

The client should copy the entire contents of the current game state into a new state struct and return it.

Optionally, the client can compute a 64-bit checksum of the data and return it.

fn load_state(&mut self, state: &T::State)[src]

Backroll will call this function at the beginning of a rollback. The argument provided will be a previously saved state returned from the save_state function.
The client should make the current game state match the state contained in the argument.

fn advance_frame(&mut self, input: GameInput<T::Input>)[src]

Called during a rollback. You should advance your game state by exactly one frame.
inputs will contain the inputs you should use for the given frame.

fn handle_event(&mut self, event: BackrollEvent)[src]

Notification that something has happened. See the [BackcrollEvent] struct for more information.

Implementors