#[repr(u32)]pub enum Position {
N = 8,
NE = 128,
E = 2_048,
SE = 32_768,
S = 524_288,
SW = 8_388_608,
W = 134_217_728,
NW = 2_147_483_648,
}Expand description
Represents a position on the game board.
The board consists of 8 positions arranged in a circle, named after cardinal and intercardinal directions. Each position is represented by a specific bit pattern for efficient bit-based operations.
§Examples
use secondbest::board::Position;
// Using a specific position
let north_position = Position::N;
// Iterating through all positions
for position in Position::iter() {
println!("Position: {:?}", position);
}Variants§
N = 8
North position (bit pattern: 0x0000_0008)
NE = 128
Northeast position (bit pattern: 0x0000_0080)
E = 2_048
East position (bit pattern: 0x0000_0800)
SE = 32_768
Southeast position (bit pattern: 0x0000_8000)
S = 524_288
South position (bit pattern: 0x0008_0000)
SW = 8_388_608
Southwest position (bit pattern: 0x0080_0000)
W = 134_217_728
West position (bit pattern: 0x0800_0000)
NW = 2_147_483_648
Northwest position (bit pattern: 0x8000_0000)
Implementations§
Trait Implementations§
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnsafeUnpin for Position
impl UnwindSafe for Position
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