pub trait GridPosition {
    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§

Construct a position from x and y coordinates.

Access the x coordinate of a position.

Access the y coordinate of a position.

Implementors§