pub struct GameControls<A: ActionSet> { /* private fields */ }Expand description
A game’s keymap and its screens, for the check on every target.
Implementations§
Source§impl<A: ActionSet> GameControls<A>
impl<A: ActionSet> GameControls<A>
Sourcepub fn new(keymap: KeymapDef<A>) -> Self
pub fn new(keymap: KeymapDef<A>) -> Self
The game whose default bindings are keymap, with no screens yet.
Sourcepub fn with(self, screen: ScreenActions<A>) -> Self
pub fn with(self, screen: ScreenActions<A>) -> Self
The same, with screen too. Every screen the game can show is
listed, overlays and popups on their own.
Sourcepub fn screens(&self) -> &[ScreenActions<A>]
pub fn screens(&self) -> &[ScreenActions<A>]
The screens listed, in order.
Sourcepub fn fit(&self, profile: &TargetProfile) -> Vec<FitProblem>
pub fn fit(&self, profile: &TargetProfile) -> Vec<FitProblem>
Every problem on profile’s target: a warning for each screen that
doesn’t declare its actions, then controls_fit on the keymap’s
table for the target. A target without a table plays with the keys
if it has a keyboard (the keymap file’s own check covers them), and
fails if it hasn’t.
Trait Implementations§
Source§impl<A: Clone + ActionSet> Clone for GameControls<A>
impl<A: Clone + ActionSet> Clone for GameControls<A>
Source§fn clone(&self) -> GameControls<A>
fn clone(&self) -> GameControls<A>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<A: ActionSet> Controls for GameControls<A>
impl<A: ActionSet> Controls for GameControls<A>
Source§fn fit(&self, profile: &TargetProfile) -> Vec<FitProblem>
fn fit(&self, profile: &TargetProfile) -> Vec<FitProblem>
Every problem of the game’s controls on the target
profile
describes (GameControls::fit).Auto Trait Implementations§
impl<A> Freeze for GameControls<A>
impl<A> RefUnwindSafe for GameControls<A>where
A: RefUnwindSafe,
impl<A> Send for GameControls<A>where
A: Send,
impl<A> Sync for GameControls<A>where
A: Sync,
impl<A> Unpin for GameControls<A>where
A: Unpin,
impl<A> UnsafeUnpin for GameControls<A>
impl<A> UnwindSafe for GameControls<A>where
A: RefUnwindSafe + UnwindSafe,
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