aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-04 15:19:39 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-04 15:19:39 +0200
commitce0b808a01081322abc7ed51e09d0f452b606ad7 (patch)
treef3574b5b1a6d935629f78ec80b5ce191c41c4cfa /src/lib.rs
parent3d107ea4710f3dec0eedd91ed5bc1e52d8f15912 (diff)
downloadgpn-tron-rust-ce0b808a01081322abc7ed51e09d0f452b606ad7.tar
gpn-tron-rust-ce0b808a01081322abc7ed51e09d0f452b606ad7.tar.bz2
gpn-tron-rust-ce0b808a01081322abc7ed51e09d0f452b606ad7.tar.zst
more code
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..a213a83
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,16 @@
+#![feature(async_closure)]
+#![feature(iterator_try_collect)]
+use std::collections::HashMap;
+
+use game::Game;
+use tokio::sync::{broadcast, RwLock};
+pub mod config;
+pub mod game;
+pub mod spectate;
+
+pub struct State {
+ pub tick: broadcast::Sender<bool>, // true for new game
+ pub game: RwLock<Game>,
+ pub players: RwLock<HashMap<u32, String>>,
+ pub chat: broadcast::Sender<(String, String)>,
+}