GridPosition

Trait GridPosition 

Source
pub trait GridPosition {
    // Required methods
    fn new(x: i32, y: i32) -> Self;
    fn x(&self) -> i32;
    fn y(&self) -> i32;
}
Expand description

Trait to implement a type that can be used as a grid position.

This trait provides access to the x and y coordinates as well as a constructor used by the grid internaly.

Required Methods§

Source

fn new(x: i32, y: i32) -> Self

Construct a position from x and y coordinates.

Source

fn x(&self) -> i32

Access the x coordinate of a position.

Source

fn y(&self) -> i32

Access the y coordinate of a position.

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§