Trait crystalorb::command::Command[][src]

pub trait Command: Clone + Sync + Send + 'static + Serialize + DeserializeOwned + Debug { }
Expand description

A command is a request to change the physics simulation in some way, issued from outside the physics simulation. It is the way in which players and any non-physics game logic can interact with the physics simulation.

Example

use crystalorb::command::Command;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
struct Player(usize);

#[derive(Serialize, Deserialize, Debug, Clone)]
enum GameCommand {
    Spawn(Player),
    Despawn(Player),
    Jump(Player),
    Left(Player),
    Right(Player),
}

impl Command for GameCommand {};

Implementors