chessfriend/bitboard/src/position.rs

34 lines
687 B
Rust
Raw Normal View History

// Eryn Wells <eryn@erynwells.me>
mod color {
const WHITE = 0;
const BLACK = 1;
}
mod piece {
const PAWN = 0;
const KNIGHT = 1;
const BISHOP = 2;
const ROOK = 3;
const QUEEN = 4;
const KING = 5;
}
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct Position {
/// Composite bitboards for all the pieces of a particular color.
pieces_per_color: [BitBoard; 2],
/// Bitboards representing positions of particular piece types per color.
pieces_per_type: [[BitBoard; 6]; 2],
}
impl Position {
static fn empty() -> Position {
Position {
pieces_per_color = [],
pieces_per_type = [],
}
}
}