Skip to main content

Cell

Trait Cell 

Source
pub trait Cell: Clone + Default {
    // Required method
    fn is_passable(&self) -> bool;

    // Provided method
    fn set_passable(&mut self) { ... }
}
Expand description

Trait for grid cells.

Implement this for custom cell types to use with Grid. The default implementation is Tile.

Required Methods§

Source

fn is_passable(&self) -> bool

Returns true if this cell is passable (walkable).

Provided Methods§

Source

fn set_passable(&mut self)

Marks this cell as passable. Default implementation is a no-op.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§