From 5d2bd4a2a6e38d75a5168afc1ef9a6cbcd90ea36 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 17 Jun 2024 13:32:18 +0200 Subject: active start / stop --- server/src/protocol.rs | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'server/src/protocol.rs') 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, -- cgit v1.2.3-70-g09d2