aboutsummaryrefslogtreecommitdiff
path: root/server/bot/src/lib.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-10-21 00:18:09 +0200
committermetamuffin <metamuffin@disroot.org>2025-10-21 00:18:11 +0200
commitb34b2a5b8d118974502c015912e1ed67fa6965b0 (patch)
treefd9aae3af50fc6e312e64934b9231f59142210ee /server/bot/src/lib.rs
parenteaed442578c3b1765ec48c84489a122096b6a08f (diff)
downloadhurrycurry-b34b2a5b8d118974502c015912e1ed67fa6965b0.tar
hurrycurry-b34b2a5b8d118974502c015912e1ed67fa6965b0.tar.bz2
hurrycurry-b34b2a5b8d118974502c015912e1ed67fa6965b0.tar.zst
more debug events, bots now broken
Diffstat (limited to 'server/bot/src/lib.rs')
-rw-r--r--server/bot/src/lib.rs12
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(),
+ )
+}