Change to RwLock over Mutex, so we can read without locking, changes to BattleRandom to allow for cloning, and prevent race conditions.

This commit is contained in:
2022-06-04 12:40:32 +02:00
parent 310bf857d2
commit df662ce6b5
7 changed files with 57 additions and 57 deletions

View File

@@ -2,6 +2,7 @@ use rand::distributions::{Distribution, Uniform};
use rand::{Rng, SeedableRng};
use rand_pcg::Pcg32;
#[derive(Clone)]
pub struct Random {
seed: u128,
distribution: Uniform<f64>,