Skip to main content

GridSize

Trait GridSize 

Source
pub trait GridSize: Grid {
    // Required method
    fn default_size(world_size_type: WorldSizeType) -> Size;

    // Provided method
    fn world_size_type(&self) -> WorldSizeType { ... }
}
Expand description

Trait for grids that can determine their world size type based on their size and provide a default size based on WorldSizeType.

Required Methods§

Source

fn default_size(world_size_type: WorldSizeType) -> Size

Get the default size of the grid based on its world size type. This is used to initialize the grid with a default size.

Provided Methods§

Source

fn world_size_type(&self) -> WorldSizeType

Get world size type of the grid based on its size.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§