Enum cozy_chess::File
source · pub enum File {
A,
B,
C,
D,
E,
F,
G,
H,
}
Expand description
A file on a chessboard.
Variants§
A
The A file.
B
The B file.
C
The C file.
D
The D file.
E
The E file.
F
The F file.
G
The G file.
H
The H file.
Implementations§
source§impl File
impl File
source§impl File
impl File
sourcepub const fn bitboard(self) -> BitBoard
pub const fn bitboard(self) -> BitBoard
Get a bitboard with all squares on this file set.
§Examples
assert_eq!(File::B.bitboard(), bitboard! {
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
});
sourcepub const fn adjacent(self) -> BitBoard
pub const fn adjacent(self) -> BitBoard
Get a bitboard with all squares on adjacent files set.
§Examples
assert_eq!(File::C.adjacent(), bitboard! {
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
. X . X . . . .
});
assert_eq!(File::A.adjacent(), bitboard! {
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
. X . . . . . .
});
assert_eq!(File::H.adjacent(), bitboard! {
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
. . . . . . X .
});
Trait Implementations§
source§impl Ord for File
impl Ord for File
source§impl PartialEq for File
impl PartialEq for File
source§impl PartialOrd for File
impl PartialOrd for File
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for File
impl Eq for File
impl StructuralPartialEq for File
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnwindSafe for File
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