You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
436 B
23 lines
436 B
use chess::Piece;
|
|
|
|
pub const PAWN: i16 = 1;
|
|
|
|
pub const HORSEY: i16 = 3;
|
|
|
|
pub const BISHOP: i16 = 5;
|
|
|
|
pub const ROOK: i16 = 5;
|
|
|
|
pub const QUEEN: i16 = 10;
|
|
|
|
pub fn get_piece_value(piece: Option<Piece>) -> i16 {
|
|
match piece {
|
|
Some(Piece::Pawn) => PAWN,
|
|
Some(Piece::Knight) => HORSEY,
|
|
Some(Piece::Bishop) => BISHOP,
|
|
Some(Piece::Rook) => ROOK,
|
|
Some(Piece::Queen) => QUEEN,
|
|
_ => 0,
|
|
}
|
|
}
|