[core] Declare Rank::PAWN_STARTING_RANKS
This is a slice that declares the pawn starting ranks for each color.
This commit is contained in:
parent
cb48413ce7
commit
1f78d4811a
1 changed files with 9 additions and 0 deletions
|
@ -159,6 +159,15 @@ impl Rank {
|
|||
Rank::SEVEN,
|
||||
Rank::EIGHT,
|
||||
];
|
||||
|
||||
/// Ranks on which pawns start, by color.
|
||||
///
|
||||
/// ```
|
||||
/// use chessfriend_core::{Color, Rank};
|
||||
/// assert_eq!(Rank::PAWN_STARTING_RANKS[Color::White as usize], Rank::TWO);
|
||||
/// assert_eq!(Rank::PAWN_STARTING_RANKS[Color::Black as usize], Rank::SEVEN);
|
||||
/// ```
|
||||
pub const PAWN_STARTING_RANKS: [Rank; 2] = [Rank::TWO, Rank::SEVEN];
|
||||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue