aboutsummaryrefslogtreecommitdiff
path: root/server/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-17 22:19:06 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-17 22:19:06 +0200
commitcc96993499c435ea706fa21a6d8089604bc44e51 (patch)
treea55f9595ca3064a1afb9494f1b9a5632616863cf /server/src/lib.rs
parent4a7480a90bc54eccd2a00ded45624783fcd1179c (diff)
downloadhurrycurry-cc96993499c435ea706fa21a6d8089604bc44e51.tar
hurrycurry-cc96993499c435ea706fa21a6d8089604bc44e51.tar.bz2
hurrycurry-cc96993499c435ea706fa21a6d8089604bc44e51.tar.zst
translate tutorial and add tile message
Diffstat (limited to 'server/src/lib.rs')
-rw-r--r--server/src/lib.rs29
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)
+ };
+}