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.
frame: Frame
The given frame
is a sanity check: The gamestate you save should be from that frame.
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.
frame: Frame
The given frame
is a sanity check: The gamestate you load is from that frame.
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> where
<T as Config>::Input: Send,
<T as Config>::State: Send,
impl<T> Sync for GGRSRequest<T> where
<T as Config>::Input: Sync,
<T as Config>::State: Send,
impl<T> Unpin for GGRSRequest<T> where
<T as Config>::Input: Unpin,
impl<T> !UnwindSafe for GGRSRequest<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more