Struct board_game_geom::Table
[−]
[src]
pub struct Table<T> { // some fields omitted }
A table that stores values for each cells.
Methods
impl<T> Table<T>
[src]
fn new(size: Size, outside: T, data: Vec<T>) -> Table<T>
Creates a new table with data.
fn new_empty(size: Size, outside: T, init: T) -> Table<T> where T: Clone
Creates a new empty table.
Trait Implementations
impl<T: PartialEq> PartialEq for Table<T>
[src]
fn eq(&self, __arg_0: &Table<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Table<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for Table<T>
[src]
impl<T: Debug> Debug for Table<T>
[src]
impl<T: Clone> Clone for Table<T>
[src]
fn clone(&self) -> Table<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<T> Geom for Table<T>
[src]
fn size(&self) -> Size
Returns the rectangle's size.
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.
impl<T> Index<Point> for Table<T>
[src]
type Output = T
The returned type after indexing
fn index(&self, p: Point) -> &T
The method for the indexing (Foo[Bar]
) operation