31 lines
618 B
Rust
31 lines
618 B
Rust
|
use crate::utils::random::Random;
|
||
|
use std::fmt::{Debug, Formatter};
|
||
|
|
||
|
pub struct BattleRandom {
|
||
|
random: Random,
|
||
|
}
|
||
|
|
||
|
impl Debug for BattleRandom {
|
||
|
fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
|
||
|
f.debug_struct("BattleRandom").finish()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl BattleRandom {
|
||
|
pub fn new() -> Self {
|
||
|
return BattleRandom {
|
||
|
random: Default::default(),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
pub fn new_with_seed(seed: u128) -> Self {
|
||
|
return BattleRandom {
|
||
|
random: Random::new(seed),
|
||
|
};
|
||
|
}
|
||
|
|
||
|
pub fn get_rng(&mut self) -> &mut Random {
|
||
|
&mut self.random
|
||
|
}
|
||
|
}
|