[board] Add inline and const modifiers to methods on PlacedPiece
This commit is contained in:
parent
b842b3520b
commit
7c2b9ed97a
1 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
// Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
use crate::Square;
|
||||
use crate::{bitboard::BitBoard, Square};
|
||||
use std::fmt;
|
||||
use std::slice::Iter;
|
||||
|
||||
|
@ -169,17 +169,24 @@ pub struct PlacedPiece {
|
|||
}
|
||||
|
||||
impl PlacedPiece {
|
||||
pub fn new(piece: Piece, square: Square) -> PlacedPiece {
|
||||
pub const fn new(piece: Piece, square: Square) -> PlacedPiece {
|
||||
PlacedPiece { piece, square }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn piece(&self) -> Piece {
|
||||
self.piece
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn square(&self) -> Square {
|
||||
self.square
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub(crate) fn bitboard(&self) -> BitBoard {
|
||||
self.square.into()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue