From ec184715933b200558e8a0fe040f8948661c7eaf Mon Sep 17 00:00:00 2001 From: Mike White Date: Mon, 23 Aug 2021 21:22:26 -0400 Subject: Created a basic UI that displays a single position --- model/src/piece.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 model/src/piece.rs (limited to 'model/src/piece.rs') diff --git a/model/src/piece.rs b/model/src/piece.rs new file mode 100644 index 0000000..f36e0a4 --- /dev/null +++ b/model/src/piece.rs @@ -0,0 +1,21 @@ +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 + } +} -- cgit v1.2.3