Enum backroll::command::Command [−][src]
pub enum Command<T> where
T: Config, { Save(SaveState<T>), Load(LoadState<T>), AdvanceFrame(GameInput<T::Input>), Event(Event), }
Expand description
A singular command for a Backroll session client to execute.
Proper execution of the command is not optional, and must be done in the exact order Commands returns it in. Filtering or altering the order in which commands are executed, or dropping commands without executing them may result incorrect simulation and/or panics.
Variants
Save(SaveState<T>)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.
Load(LoadState<T>)Backroll will issue this command 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.
Clients should advance the game state by exactly one frame.
The provided inputs will contain the inputs you should use for the given frame.
Event(Event)Notification that something has happened in the lower level protocols. See the
[Event] struct for more information.
Auto Trait Implementations
impl<T> !RefUnwindSafe for Command<T>impl<T> !UnwindSafe for Command<T>