diff options
Diffstat (limited to 'server/protocol/src')
| -rw-r--r-- | server/protocol/src/lib.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/protocol/src/lib.rs b/server/protocol/src/lib.rs index b686fcee..2be37730 100644 --- a/server/protocol/src/lib.rs +++ b/server/protocol/src/lib.rs @@ -369,6 +369,15 @@ pub enum ItemLocation { Player(PlayerID, Hand), } +impl ItemLocation { + pub fn is_tile(&self) -> bool { + matches!(self, Self::Tile(..)) + } + pub fn is_player(&self) -> bool { + matches!(self, Self::Player(..)) + } +} + fn deser_i64<'de, D: Deserializer<'de>>(deserializer: D) -> Result<i64, D::Error> { let x = f64::deserialize(deserializer)?; Ok(x.trunc() as i64) |