summaryrefslogtreecommitdiff
path: root/model/src/piece.rs
blob: f36e0a4b13c7034e099037685bccfdaa243f752f (plain)
use crate::PieceColor;

#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct Piece {
	king: bool,
	color: PieceColor,
}

impl Piece {
	pub(crate) const fn new(king: bool, color: PieceColor) -> Self {
		Self { king, color }
	}

	pub const fn is_king(self) -> bool {
		self.king
	}

	pub const fn color(self) -> PieceColor {
		self.color
	}
}