[board] Clean up Display and Debug implementations on BitBoard, Flags, Position, and PlacedPiece
This commit is contained in:
parent
2269df2ed9
commit
c413db0bf1
4 changed files with 16 additions and 29 deletions
|
@ -2,8 +2,9 @@
|
|||
|
||||
use super::position::BoardSide;
|
||||
use crate::piece::Color;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
|
||||
#[derive(Clone, Copy, Eq, Hash, PartialEq)]
|
||||
pub(super) struct Flags(u8);
|
||||
|
||||
impl Flags {
|
||||
|
@ -25,6 +26,12 @@ impl Flags {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Flags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "Flags({:08b})", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Flags {
|
||||
fn default() -> Self {
|
||||
Flags(0b00001111)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue