From 5f3e5f473c6d7a45297c4d301eb2a2d61078586b Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Wed, 7 Feb 2024 19:15:07 -0800 Subject: Modularize --- src/card/player.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/card/player.rs (limited to 'src/card/player.rs') 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") + }, + } + } +} -- cgit v1.2.1