Struct radiant_rs::utils::Rng
[−]
[src]
pub struct Rng(_);
A very simple, seedable random number generator based on sin(). It is provided to simplify experimentation with the library but not suitable for applications that require good quality random numbers.
Methods
impl Rng
[src]
fn new<T>(seed: T) -> Rng where
T: FromPrimitive + ToPrimitive + Copy,
[src]
T: FromPrimitive + ToPrimitive + Copy,
Creates a new instance with given seed.
fn get<T>(&mut self) -> T where
T: FromPrimitive + ToPrimitive + Copy,
[src]
T: FromPrimitive + ToPrimitive + Copy,
Returns a random number between 0.0 and non-inclusive 1.0
fn range<T>(&mut self, min: T, max: T) -> T where
T: FromPrimitive + ToPrimitive + Copy,
[src]
T: FromPrimitive + ToPrimitive + Copy,
Returns a random number between min and non-inclusive max.
fn chose<'a, T>(&mut self, source: &'a [T]) -> &'a T
[src]
Returns a random item from given slice.