diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-17 13:32:18 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-17 13:32:18 +0200 |
commit | 5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36 (patch) | |
tree | cab52ea116eb19fc2a0a3b2158b2086b6db790a9 /server/src/protocol.rs | |
parent | 3f23989c2829a4a99349d4670511d71c0f4af8e1 (diff) | |
download | hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar.bz2 hurrycurry-5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36.tar.zst |
active start / stop
Diffstat (limited to 'server/src/protocol.rs')
-rw-r--r-- | server/src/protocol.rs | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/server/src/protocol.rs b/server/src/protocol.rs index 0218658d..a318a9b2 100644 --- a/server/src/protocol.rs +++ b/server/src/protocol.rs @@ -3,24 +3,13 @@ use serde::{Deserialize, Serialize}; pub type ID = u32; -#[derive(Debug, Clone, Copy, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum Item { - Flour, - Water, - Dough, - Pancake, -} +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(transparent)] +pub struct Item(pub String); -#[derive(Debug, Clone, Copy, Serialize, Deserialize)] -#[serde(rename_all = "snake_case")] -pub enum Tile { - Sink, - FlourBag, - Floor, - Table, - Pan, -} +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(transparent)] +pub struct Tile(pub String); #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] @@ -28,7 +17,7 @@ pub enum PacketS { Join { name: String }, Leave, Position { pos: Vec2, rot: f32 }, - Interact { pos: IVec2 }, + Interact { pos: IVec2, edge: bool }, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -69,6 +58,7 @@ pub enum PacketC { }, SetActive { tile: IVec2, + progress: f32, }, UpdateMap { pos: IVec2, |