Trait board_game_geom::Geom [] [src]

pub trait Geom {
    fn size(&self) -> Size;

    fn row(&self) -> i32 { ... }
    fn column(&self) -> i32 { ... }
    fn cell_len(&self) -> usize { ... }
    fn contains(&self, p: Point) -> bool { ... }
    fn point_to_cellid(&self, p: Point) -> CellId { ... }
    fn cellid_to_point(&self, id: CellId) -> Point { ... }
    fn points(&self) -> Points { ... }
    fn points_in_row(&self, row: i32) -> PointsInRow { ... }
    fn points_in_column(&self, column: i32) -> PointsInColumn { ... }
}

A rectangle area.

Required Methods

fn size(&self) -> Size

Returns the rectangle's size.

Provided Methods

fn row(&self) -> i32

Returns the number of the rectangle's rows.

fn column(&self) -> i32

Returns the number of the rectangle's columns.

fn cell_len(&self) -> usize

Returns the cell length which is contained in the rectangle.

fn contains(&self, p: Point) -> bool

Returns true if the point is contained in the rectangle.

fn point_to_cellid(&self, p: Point) -> CellId

Convert a point to a corresponding cell ID.

fn cellid_to_point(&self, id: CellId) -> Point

Convert a cell ID to a corresponding point.

fn points(&self) -> Points

Returns an iterator iterating all points.

fn points_in_row(&self, row: i32) -> PointsInRow

Returns an iterator iterating all points in the row.

fn points_in_column(&self, column: i32) -> PointsInColumn

Returns an iterator iterating all points in the column.

Implementors