diff options
Diffstat (limited to 'server/bot/src/lib.rs')
| -rw-r--r-- | server/bot/src/lib.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/server/bot/src/lib.rs b/server/bot/src/lib.rs index 337d18e8..078314b1 100644 --- a/server/bot/src/lib.rs +++ b/server/bot/src/lib.rs @@ -22,6 +22,8 @@ pub mod step; use hurrycurry_game_core::Game; use hurrycurry_protocol::PacketS; +#[cfg(feature = "debug_events")] +use hurrycurry_protocol::{PlayerID, glam::Vec3}; use std::{collections::VecDeque, random::random}; pub struct PacketSink<'a> { @@ -55,3 +57,13 @@ impl<T: BotAlgo + ?Sized> BotAlgo for Box<T> { fn random_float() -> f32 { random::<u32>(..) as f32 / u32::MAX as f32 } + +#[cfg(feature = "debug_events")] +fn debug_player_color(d: PlayerID) -> Vec3 { + use std::f32::consts::TAU; + Vec3::new( + (d.0 as f32 + TAU / 3. * 0.).sin(), + (d.0 as f32 + TAU / 3. * 1.).sin(), + (d.0 as f32 + TAU / 3. * 2.).sin(), + ) +} |