Skip to main content

Entity

Trait Entity 

Source
pub trait Entity {
    // Required methods
    fn id(&self) -> PlayerId;
    fn name(&self) -> &str;
    fn vision(&self) -> usize;
    fn speed(&self) -> u64;
    fn position(&self) -> Position;
    fn direction(&self) -> Direction;
    fn maze_id(&self) -> usize;

    // Provided methods
    fn view(&self) -> View { ... }
    fn movement_recovery_duration(&self) -> Duration { ... }
}

Required Methods§

Source

fn id(&self) -> PlayerId

Source

fn name(&self) -> &str

Source

fn vision(&self) -> usize

Source

fn speed(&self) -> u64

Source

fn position(&self) -> Position

Source

fn direction(&self) -> Direction

Source

fn maze_id(&self) -> usize

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§