summaryrefslogtreecommitdiff
path: root/src/card/player.rs
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-02-07 19:15:07 -0800
committerChristian Cunningham <cc@localhost>2024-02-07 19:15:07 -0800
commit5f3e5f473c6d7a45297c4d301eb2a2d61078586b (patch)
treebd725a5d16dc27a1c7b5b0997732feb57aaa3192 /src/card/player.rs
parentccc015a370b87cebec77c3f48cd72ec3039dea6d (diff)
Modularize
Diffstat (limited to 'src/card/player.rs')
-rw-r--r--src/card/player.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/card/player.rs b/src/card/player.rs
new file mode 100644
index 0000000..1439258
--- /dev/null
+++ b/src/card/player.rs
@@ -0,0 +1,30 @@
+#[allow(non_camel_case_types)]
+#[allow(dead_code)]
+#[derive(Copy,Clone)]
+pub enum PlayerId {
+ NONE,
+ PLAYER_1,
+ PLAYER_2,
+}
+
+impl Default for PlayerId {
+ fn default() -> Self {
+ PlayerId::NONE
+ }
+}
+
+impl core::fmt::Debug for PlayerId {
+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
+ match *self {
+ PlayerId::NONE => {
+ write!(f, "PlayerId::NONE ")
+ },
+ PlayerId::PLAYER_1 => {
+ write!(f, "PlayerId::PLAYER_1")
+ },
+ PlayerId::PLAYER_2 => {
+ write!(f, "PlayerId::PLAYER_2")
+ },
+ }
+ }
+}