#[repr(u8)]pub enum SquareCoordinate {
Show 65 variants
A8 = 0,
B8 = 1,
C8 = 2,
D8 = 3,
E8 = 4,
F8 = 5,
G8 = 6,
H8 = 7,
A7 = 16,
B7 = 17,
C7 = 18,
D7 = 19,
E7 = 20,
F7 = 21,
G7 = 22,
H7 = 23,
A6 = 32,
B6 = 33,
C6 = 34,
D6 = 35,
E6 = 36,
F6 = 37,
G6 = 38,
H6 = 39,
A5 = 48,
B5 = 49,
C5 = 50,
D5 = 51,
E5 = 52,
F5 = 53,
G5 = 54,
H5 = 55,
A4 = 64,
B4 = 65,
C4 = 66,
D4 = 67,
E4 = 68,
F4 = 69,
G4 = 70,
H4 = 71,
A3 = 80,
B3 = 81,
C3 = 82,
D3 = 83,
E3 = 84,
F3 = 85,
G3 = 86,
H3 = 87,
A2 = 96,
B2 = 97,
C2 = 98,
D2 = 99,
E2 = 100,
F2 = 101,
G2 = 102,
H2 = 103,
A1 = 112,
B1 = 113,
C1 = 114,
D1 = 115,
E1 = 116,
F1 = 117,
G1 = 118,
H1 = 119,
__BAD_COORD = 200,
}Variants§
A8 = 0
B8 = 1
C8 = 2
D8 = 3
E8 = 4
F8 = 5
G8 = 6
H8 = 7
A7 = 16
B7 = 17
C7 = 18
D7 = 19
E7 = 20
F7 = 21
G7 = 22
H7 = 23
A6 = 32
B6 = 33
C6 = 34
D6 = 35
E6 = 36
F6 = 37
G6 = 38
H6 = 39
A5 = 48
B5 = 49
C5 = 50
D5 = 51
E5 = 52
F5 = 53
G5 = 54
H5 = 55
A4 = 64
B4 = 65
C4 = 66
D4 = 67
E4 = 68
F4 = 69
G4 = 70
H4 = 71
A3 = 80
B3 = 81
C3 = 82
D3 = 83
E3 = 84
F3 = 85
G3 = 86
H3 = 87
A2 = 96
B2 = 97
C2 = 98
D2 = 99
E2 = 100
F2 = 101
G2 = 102
H2 = 103
A1 = 112
B1 = 113
C1 = 114
D1 = 115
E1 = 116
F1 = 117
G1 = 118
H1 = 119
__BAD_COORD = 200
Implementations§
Source§impl SquareCoordinate
impl SquareCoordinate
Sourcepub fn to_index(&self) -> usize
pub fn to_index(&self) -> usize
Convert a Square enum to its associated value (A8 = 0, B8 = 1, etc.)
pub fn is_light_sq(&self) -> bool
pub fn is_dark_sq(&self) -> bool
pub fn rank(&self) -> u8
pub fn file(&self) -> u8
pub fn above(&self) -> Result<Self, ChessError>
pub fn below(&self) -> Result<Self, ChessError>
pub fn left(&self) -> Result<Self, ChessError>
pub fn right(&self) -> Result<Self, ChessError>
pub fn upper_left(&self) -> Result<Self, ChessError>
pub fn upper_right(&self) -> Result<Self, ChessError>
pub fn lower_left(&self) -> Result<Self, ChessError>
pub fn lower_right(&self) -> Result<Self, ChessError>
pub fn subtract(&self, rhs: usize) -> Result<Self, ChessError>
Trait Implementations§
Source§impl Clone for SquareCoordinate
impl Clone for SquareCoordinate
Source§fn clone(&self) -> SquareCoordinate
fn clone(&self) -> SquareCoordinate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SquareCoordinate
impl Debug for SquareCoordinate
Source§impl PartialEq for SquareCoordinate
impl PartialEq for SquareCoordinate
impl Copy for SquareCoordinate
impl Eq for SquareCoordinate
impl StructuralPartialEq for SquareCoordinate
Auto Trait Implementations§
impl Freeze for SquareCoordinate
impl RefUnwindSafe for SquareCoordinate
impl Send for SquareCoordinate
impl Sync for SquareCoordinate
impl Unpin for SquareCoordinate
impl UnwindSafe for SquareCoordinate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more