aboutsummaryrefslogtreecommitdiff
path: root/server/bot/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-08-12 16:25:31 +0200
committermetamuffin <metamuffin@disroot.org>2024-08-12 16:25:31 +0200
commit00c1c6af949ae50c2b061919a76ac5a0bb061791 (patch)
treec559b73807146a5046f572aaf051c08879ef7d48 /server/bot/src/lib.rs
parent2a81c045deffa481d4021f3ef960e2fb706ff011 (diff)
downloadhurrycurry-00c1c6af949ae50c2b061919a76ac5a0bb061791.tar
hurrycurry-00c1c6af949ae50c2b061919a76ac5a0bb061791.tar.bz2
hurrycurry-00c1c6af949ae50c2b061919a76ac5a0bb061791.tar.zst
bot: make crate hybrid
Diffstat (limited to 'server/bot/src/lib.rs')
-rw-r--r--server/bot/src/lib.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs
new file mode 100644
index 00000000..e8f05fd6
--- /dev/null
+++ b/server/bot/src/lib.rs
@@ -0,0 +1,19 @@
+#![feature(isqrt)]
+pub mod algos;
+pub mod pathfinding;
+
+use hurrycurry_client_lib::Game;
+use hurrycurry_protocol::{
+ glam::{IVec2, Vec2},
+ PlayerID,
+};
+
+#[derive(Default, Clone, Copy)]
+pub struct BotInput {
+ pub direction: Vec2,
+ pub boost: bool,
+ pub interact: Option<IVec2>,
+}
+pub trait BotAlgo {
+ fn tick(&mut self, me: PlayerID, game: &Game, dt: f32) -> BotInput;
+}