Struct mon_artist::grid::Pt
[−]
[src]
pub struct Pt(pub i32, pub i32);
A Pt
is a trivial representation of a (row, column) in the grid.
Note that we use one-based indices when referring to row or column;
use the fn row_idx
or col_idx
methods to get 0-based indices.
Methods
impl Pt
[src]
fn col(&self) -> i32
fn row(&self) -> i32
fn row_idx(&self) -> usize
fn col_idx(&self) -> usize
fn shift(&self, dcol: i32, drow: i32) -> Pt
fn e(&self) -> Pt
fn n(&self) -> Pt
fn s(&self) -> Pt
fn w(&self) -> Pt
fn towards(&self, target: Pt) -> Direction
impl Pt
[src]
fn rowcol(r: i32, c: i32) -> Pt
fn colrow(c: i32, r: i32) -> Pt
fn neighbor(&self, dir: Direction) -> Pt
Trait Implementations
impl PartialEq for Pt
[src]
fn eq(&self, __arg_0: &Pt) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Pt) -> bool
This method tests for !=
.
impl Eq for Pt
[src]
impl Copy for Pt
[src]
impl Clone for Pt
[src]
fn clone(&self) -> Pt
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 Debug for Pt
[src]
impl Hash for Pt
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.