[bitboard] Specify array lengths with ::NUM values from core types
These were static bare integer values. Use ::NUM properties of various core types instead.
This commit is contained in:
parent
93c17a2740
commit
bba910090c
1 changed files with 5 additions and 5 deletions
|
@ -9,12 +9,12 @@
|
|||
//! provides getters for all available bitboards.
|
||||
|
||||
use crate::BitBoard;
|
||||
use chessfriend_core::{Color, Direction, Square};
|
||||
use chessfriend_core::{Color, Direction, File, Rank, Square};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
#[allow(clippy::identity_op)]
|
||||
#[allow(clippy::erasing_op)]
|
||||
pub(crate) const RANKS: [BitBoard; 8] = [
|
||||
pub(crate) const RANKS: [BitBoard; Rank::NUM] = [
|
||||
BitBoard(0xFF << (0 * 8)),
|
||||
BitBoard(0xFF << (1 * 8)),
|
||||
BitBoard(0xFF << (2 * 8)),
|
||||
|
@ -27,7 +27,7 @@ pub(crate) const RANKS: [BitBoard; 8] = [
|
|||
|
||||
#[allow(clippy::identity_op)]
|
||||
#[allow(clippy::erasing_op)]
|
||||
pub(crate) const FILES: [BitBoard; 8] = [
|
||||
pub(crate) const FILES: [BitBoard; File::NUM] = [
|
||||
BitBoard(0x0101_0101_0101_0101 << 0),
|
||||
BitBoard(0x0101_0101_0101_0101 << 1),
|
||||
BitBoard(0x0101_0101_0101_0101 << 2),
|
||||
|
@ -39,13 +39,13 @@ pub(crate) const FILES: [BitBoard; 8] = [
|
|||
];
|
||||
|
||||
/// Bitboards representing the kingside of the board, per color.
|
||||
pub(crate) const KINGSIDES: [BitBoard; 2] = [
|
||||
pub(crate) const KINGSIDES: [BitBoard; Color::NUM] = [
|
||||
BitBoard(0xF0F0_F0F0_F0F0_F0F0),
|
||||
BitBoard(0x0F0F_0F0F_0F0F_0F0F),
|
||||
];
|
||||
|
||||
/// Bitboards representing the queenside of the board, per color.
|
||||
pub(crate) const QUEENSIDES: [BitBoard; 2] = [
|
||||
pub(crate) const QUEENSIDES: [BitBoard; Color::NUM] = [
|
||||
BitBoard(0x0F0F_0F0F_0F0F_0F0F),
|
||||
BitBoard(0xF0F0_F0F0_F0F0_F0F0),
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue