[][src]Trait tokyo::Handler

pub trait Handler {
    fn tick(&mut self, state: &ClientState) -> Option<GameCommand>;
}

Handler is provided as the trait that players can implement to interact with the game server.

Required methods

fn tick(&mut self, state: &ClientState) -> Option<GameCommand>

An opportunity, provided multiple times a second, to analyze the current state of the world and do a single action based on its state. It's not called when the player is dead and waiting to be respawn.

Loading content...

Implementors

Loading content...