Trait board_game_geom::Geom
source · [−]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ⓘNotable traits for Pointsimpl Iterator for Points type Item = Point;
{ ... }
fn points_in_row(&self, row: i32) -> PointsInRowⓘNotable traits for PointsInRowimpl Iterator for PointsInRow type Item = Point;
{ ... }
fn points_in_column(&self, column: i32) -> PointsInColumnⓘNotable traits for PointsInColumnimpl Iterator for PointsInColumn type Item = Point;
{ ... }
}
Expand description
A rectangle area.
Required Methods
Provided Methods
fn point_to_cellid(&self, p: Point) -> CellId
fn point_to_cellid(&self, p: Point) -> CellId
Convert a point to a corresponding cell ID.
fn cellid_to_point(&self, id: CellId) -> Point
fn cellid_to_point(&self, id: CellId) -> Point
Convert a cell ID to a corresponding point.
Returns an iterator iterating all points.
fn points_in_row(&self, row: i32) -> PointsInRowⓘNotable traits for PointsInRowimpl Iterator for PointsInRow type Item = Point;
fn points_in_row(&self, row: i32) -> PointsInRowⓘNotable traits for PointsInRowimpl Iterator for PointsInRow type Item = Point;
Returns an iterator iterating all points in the row.
fn points_in_column(&self, column: i32) -> PointsInColumnⓘNotable traits for PointsInColumnimpl Iterator for PointsInColumn type Item = Point;
fn points_in_column(&self, column: i32) -> PointsInColumnⓘNotable traits for PointsInColumnimpl Iterator for PointsInColumn type Item = Point;
Returns an iterator iterating all points in the column.