[][src]Trait rask_engine::GameEngine

pub trait GameEngine {
    fn new(pool: Arc<ThreadPool>) -> Self;
fn load_level(level: Level);
fn handle_event(&mut self, event: Event) -> Result<(), EngineError>;
fn tick(&mut self, dt: Duration) -> Result<(), EngineError>; }

An interface for the game server to interact with the game.

Required methods

fn new(pool: Arc<ThreadPool>) -> Self

Create a new game.

fn load_level(level: Level)

fn handle_event(&mut self, event: Event) -> Result<(), EngineError>

Let the game engine handle the given event. May cause an EngineError.

fn tick(&mut self, dt: Duration) -> Result<(), EngineError>

Do a logic tick. May cause an EngineError.

Loading content...

Implementors

impl GameEngine for RaskEngine[src]

Loading content...