diff options
author | metamuffin <metamuffin@disroot.org> | 2024-08-12 16:25:31 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-08-12 16:25:31 +0200 |
commit | 00c1c6af949ae50c2b061919a76ac5a0bb061791 (patch) | |
tree | c559b73807146a5046f572aaf051c08879ef7d48 /server/bot/src/lib.rs | |
parent | 2a81c045deffa481d4021f3ef960e2fb706ff011 (diff) | |
download | hurrycurry-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.rs | 19 |
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; +} |