moved some stuff into random util

This commit is contained in:
2025-04-19 21:43:10 -04:00
parent 876c6bc301
commit 5799afa38e
4 changed files with 8 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
use rand::rngs::ThreadRng;
use rand::Rng;
pub struct RandomGen {
pub rng: ThreadRng,
@@ -10,4 +11,8 @@ impl RandomGen {
rng: rand::thread_rng(),
}
}
pub fn range_random_from_one(&mut self, limit: i32) -> i32 {
self.rng.gen_range(1..limit)
}
}