diff options
Diffstat (limited to 'server/src/lib.rs')
-rw-r--r-- | server/src/lib.rs | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/server/src/lib.rs b/server/src/lib.rs index 89822133..3969c67c 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -16,13 +16,13 @@ */ #![feature(if_let_guard, map_many_mut, let_chains, iterator_try_collect, isqrt)] +pub mod commands; pub mod data; pub mod entity; -pub mod server; pub mod interaction; -pub mod state; pub mod scoreboard; -pub mod commands; +pub mod server; +pub mod state; use hurrycurry_protocol::glam::Vec2; @@ -43,3 +43,26 @@ impl InterpolateExt for f32 { *self = target + (*self - target) * (-dt).exp(); } } + +#[macro_export] +macro_rules! trm { + ($id:literal $(, $typ:ident = $param:expr)*) => { + hurrycurry_protocol::Message::Translation { + id: $id.to_owned(), + params: vec![$(crate::trm_param!($typ, $param)),*] + } + }; +} + +#[macro_export] +macro_rules! trm_param { + (s, $x:expr) => { + hurrycurry_protocol::Message::Text($x) + }; + (i, $x:expr) => { + hurrycurry_protocol::Message::Item($x) + }; + (t, $x:expr) => { + hurrycurry_protocol::Message::Tile($x) + }; +} |