diff options
Diffstat (limited to 'model/src/piece.rs')
| -rwxr-xr-x[-rw-r--r--] | model/src/piece.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/model/src/piece.rs b/model/src/piece.rs index f36e0a4..860142d 100644..100755 --- a/model/src/piece.rs +++ b/model/src/piece.rs @@ -1,21 +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 - } -} +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
+ }
+}
|
