pub trait PlayState {
    // Required methods
    fn enter(&mut self, global_state: &mut GlobalState, direction: Direction);
    fn tick(
        &mut self,
        global_state: &mut GlobalState,
        events: Vec<Event>
    ) -> PlayStateResult;
    fn name(&self) -> &'static str;
    fn capped_fps(&self) -> bool;
    fn globals_bind_group(&self) -> &GlobalsBindGroup;
    fn render(&self, drawer: &mut Drawer<'_>, settings: &Settings);
    fn egui_enabled(&self) -> bool;
}
Expand description

A trait representing a playable game state. This may be a menu, a game session, the title screen, etc.

Required Methods§

source

fn enter(&mut self, global_state: &mut GlobalState, direction: Direction)

Called when entering this play state from another

source

fn tick( &mut self, global_state: &mut GlobalState, events: Vec<Event> ) -> PlayStateResult

Tick the play state

source

fn name(&self) -> &'static str

Get a descriptive name for this state type.

source

fn capped_fps(&self) -> bool

Determines whether the play state should have an enforced FPS cap

source

fn globals_bind_group(&self) -> &GlobalsBindGroup

source

fn render(&self, drawer: &mut Drawer<'_>, settings: &Settings)

Draw the play state.

source

fn egui_enabled(&self) -> bool

Determines whether egui will be rendered for this play state

Implementors§