This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

at main 552 B View raw
1use rand::Rng; 2 3use crate::{Point, Region}; 4 5impl Point { 6 pub fn random(rng: &mut impl Rng, within: &Region) -> Self { 7 within.ensure_nonempty().unwrap(); 8 Self::Corner( 9 rng.random_range(within.x_range()), 10 rng.random_range(within.y_range()), 11 ) 12 } 13 14 pub fn random_center(rng: &mut impl Rng, within: &Region) -> Self { 15 within.ensure_nonempty().unwrap(); 16 Self::Center( 17 rng.random_range(within.x_range()), 18 rng.random_range(within.y_range()), 19 ) 20 } 21}