Trait gg::scene::SceneManager [] [src]

pub trait SceneManager<T: Sized> {
    type Scene: ?Sized + HasId = Scene<State=T>;
    type SceneTransition = SceneTransition<T>;
    fn get_scenes(&self) -> &Vec<Box<Self::Scene>>;
    fn get_scenes_mut(&mut self) -> &mut Vec<Box<Self::Scene>>;
    fn handle_transition(&mut self, Self::SceneTransition);
    fn update(&mut self, dt: f64, keys: &Keys);
    fn display(&mut self, display: &GlutinFacade);
}

This trait has to be implemented by the SceneManager that will run your game. A sample implementation is StackSceneManager

Associated Types

type Scene: ?Sized + HasId = Scene<State=T>

The Associated Scene

type SceneTransition = SceneTransition<T>

The Associated SceneTransition

Required Methods

fn get_scenes(&self) -> &Vec<Box<Self::Scene>>

Return the scenes as non-mut references

fn get_scenes_mut(&mut self) -> &mut Vec<Box<Self::Scene>>

Return the scenes as mut references

fn handle_transition(&mut self, Self::SceneTransition)

Make the manager handle a given transition.

fn update(&mut self, dt: f64, keys: &Keys)

Update the scene/s

fn display(&mut self, display: &GlutinFacade)

Display the scene/s

Implementors