35 lines
536 B
Rust
35 lines
536 B
Rust
|
// Eryn Wells <eryn@erynwells.me>
|
||
|
|
||
|
#[derive(Debug, Eq, PartialEq)]
|
||
|
pub enum Color {
|
||
|
White,
|
||
|
Black,
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Eq, PartialEq)]
|
||
|
pub enum PieceShape {
|
||
|
Pawn,
|
||
|
Knight,
|
||
|
Bishop,
|
||
|
Rook,
|
||
|
Queen,
|
||
|
King,
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Eq, PartialEq)]
|
||
|
pub enum PiecePlacementError {
|
||
|
PieceExistsOnSquare,
|
||
|
}
|
||
|
|
||
|
#[derive(Debug, Eq, PartialEq)]
|
||
|
pub struct Piece {
|
||
|
pub color: Color,
|
||
|
pub piece: PieceShape,
|
||
|
}
|
||
|
|
||
|
impl Piece {
|
||
|
pub fn new(color: Color, piece: PieceShape) -> Piece {
|
||
|
Piece { color, piece }
|
||
|
}
|
||
|
}
|