Enum ggrs::GgrsRequest
source · pub enum GgrsRequest<T>where
T: Config,{
SaveGameState {
cell: GameStateCell<T::State>,
frame: Frame,
},
LoadGameState {
cell: GameStateCell<T::State>,
frame: Frame,
},
AdvanceFrame {
inputs: Vec<(T::Input, InputStatus)>,
},
}
Expand description
Requests that you can receive from the session. Handling them is mandatory.
Variants§
SaveGameState
Fields
§
cell: GameStateCell<T::State>
Use cell.save(...)
to save your state.
You should save the current gamestate in the cell
provided to you. The given frame
is a sanity check: The gamestate you save should be from that frame.
LoadGameState
Fields
§
cell: GameStateCell<T::State>
Use cell.load()
to load your state.
You should load the gamestate in the cell
provided to you. The given frame
is a sanity check: The gamestate you load should be from that frame.
AdvanceFrame
Fields
§
inputs: Vec<(T::Input, InputStatus)>
Contains inputs and input status for each player.
You should advance the gamestate with the inputs
provided to you.
Disconnected players are indicated by having NULL_FRAME
instead of the correct current frame in their input.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for GgrsRequest<T>
impl<T> Send for GgrsRequest<T>
impl<T> Sync for GgrsRequest<T>
impl<T> Unpin for GgrsRequest<T>
impl<T> !UnwindSafe for GgrsRequest<T>
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