diff options
Diffstat (limited to 'server/bot/src/lib.rs')
| -rw-r--r-- | server/bot/src/lib.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs index cc1cb2a8..927ac7b0 100644 --- a/server/bot/src/lib.rs +++ b/server/bot/src/lib.rs @@ -15,14 +15,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#![feature(random)] pub mod algos; pub mod pathfinding; use hurrycurry_client_lib::Game; use hurrycurry_protocol::{ - glam::{IVec2, Vec2}, PacketS, PlayerID, + glam::{IVec2, Vec2}, }; +use std::random::random; #[derive(Default, Clone)] pub struct BotInput { @@ -43,3 +45,7 @@ impl<T: BotAlgo + ?Sized> BotAlgo for Box<T> { (**self).tick(me, game, dt) } } + +fn random_float() -> f32 { + random::<u32>(..) as f32 / u32::MAX as f32 +} |