Struct board_game_geom::Move
[−]
[src]
pub struct Move(pub i32, pub i32);
A difference between two Point
s.
Point(y0, x0)
- Point(y1, x1) ==
Move(y0 - y1, x0 - x1)`
Methods
impl Move
[src]
const UP: Move = Move(-1, 0)
An upward Move
vector.
const RIGHT: Move = Move(0, 1)
A rightward Move
vector.
const DOWN: Move = Move(1, 0)
A downward Move
vector.
const LEFT: Move = Move(0, -1)
A leftward Move
vector.
const ALL_DIRECTIONS: [Move; 4] = [Move::UP, Move::RIGHT, Move::DOWN, Move::LEFT]
Move
vectors that is toward four adjacent points.
const ALL_ADJACENTS: [Move; 8] = [Move::UP, Move(-1, 1), Move::RIGHT, Move(1, 1), Move::DOWN, Move(1, -1),
Move::LEFT, Move(-1, -1)]
Move
vectors that is toward eight adjacent points.
Trait Implementations
impl Hash for Move
[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.
impl PartialEq for Move
[src]
fn eq(&self, __arg_0: &Move) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Move) -> bool
This method tests for !=
.
impl Eq for Move
[src]
impl Debug for Move
[src]
impl Copy for Move
[src]
impl Clone for Move
[src]
fn clone(&self) -> Move
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 Add<Move> for Move
[src]
type Output = Move
The resulting type after applying the +
operator
fn add(self, other: Move) -> Move
The method for the +
operator
impl Sub<Move> for Move
[src]
type Output = Move
The resulting type after applying the -
operator
fn sub(self, other: Move) -> Move
The method for the -
operator
impl Neg for Move
[src]
type Output = Move
The resulting type after applying the -
operator
fn neg(self) -> Move
The method for the unary -
operator