1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use std::fmt::Debug;
use rand::Rng;
use crate::Builder;
pub use self::bridson::Bridson;
pub use self::ebeida::Ebeida;
mod bridson;
mod ebeida;
pub trait Creator: Copy + Debug {
type Algo: Algorithm;
fn create(_: &Builder) -> Self::Algo;
}
pub trait Algorithm {
fn next<R>(&mut self, _: &mut Builder, _: &mut R) -> Option<mint::Vector2<f32>>
where
R: Rng;
fn size_hint(&self, _: &Builder) -> (usize, Option<usize>);
fn restrict(&mut self, _: mint::Vector2<f32>);
fn stays_legal(&self, _: &Builder, _: mint::Vector2<f32>) -> bool;
}