diff options
author | metamuffin <metamuffin@disroot.org> | 2024-12-25 19:37:20 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-12-25 19:37:20 +0100 |
commit | bd74a4e0c0e4e42717c2931eab3febfae219ac9c (patch) | |
tree | 30d6dc91921aab9a8ffd271901d8122891560a65 /server/protocol/src/helpers.rs | |
parent | 462bc5a62f24a35e05d6a171566495e2641583a8 (diff) | |
download | hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar.bz2 hurrycurry-bd74a4e0c0e4e42717c2931eab3febfae219ac9c.tar.zst |
variable hand count
Diffstat (limited to 'server/protocol/src/helpers.rs')
-rw-r--r-- | server/protocol/src/helpers.rs | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/server/protocol/src/helpers.rs b/server/protocol/src/helpers.rs index 21835101..b85c2f84 100644 --- a/server/protocol/src/helpers.rs +++ b/server/protocol/src/helpers.rs @@ -106,26 +106,7 @@ impl Display for ItemLocation { impl Display for Hand { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(match self { - Hand::Left => "left", - Hand::Right => "right", - }) - } -} - -impl Hand { - pub fn index(&self) -> usize { - match self { - Hand::Left => 0, - Hand::Right => 1, - } - } - pub fn from_index(i: usize) -> Self { - match i { - 0 => Hand::Left, - 1 => Hand::Right, - _ => Hand::Left, - } + write!(f, "h{}", self.0) } } |