Struct board_game_geom::Rotation [] [src]

pub struct Rotation(_, _, _, _);

A 2x2 rotation matrix.

Rotation(yy, yx, xy, xx) * Move(y, x) == Move(yy*y + yx*x, xy*y + xx*x)

Methods

impl Rotation
[src]

const CCW0: Rotation = Rotation(1, 0, 0, 1)

A 0-degree Rotation to the left (counterclockwise).

const CCW90: Rotation = Rotation(0, -1, 1, 0)

A 90-degree Rotation to the left (counterclockwise).

const CCW180: Rotation = Rotation(-1, 0, 0, -1)

A 180-degree Rotation to the left (counterclockwise).

const CCW270: Rotation = Rotation(0, 1, -1, 0)

A 270-degree Rotation to the left (counterclockwise).

const H_FLIP: Rotation = Rotation(1, 0, 0, -1)

Flip horizontal.

const V_FLIP: Rotation = Rotation(-1, 0, 0, 1)

Flip vertical.

Trait Implementations

impl Hash for Rotation
[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 Rotation
[src]

fn eq(&self, __arg_0: &Rotation) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Rotation) -> bool

This method tests for !=.

impl Eq for Rotation
[src]

impl Debug for Rotation
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Copy for Rotation
[src]

impl Clone for Rotation
[src]

fn clone(&self) -> Rotation

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 Mul<Rotation> for Rotation
[src]

type Output = Rotation

The resulting type after applying the * operator

fn mul(self, other: Rotation) -> Rotation

The method for the * operator

impl Mul<Move> for Rotation
[src]

type Output = Move

The resulting type after applying the * operator

fn mul(self, other: Move) -> Move

The method for the * operator