author | unc0rr |
Wed, 31 Oct 2018 23:36:05 +0100 | |
changeset 14056 | 8a0d69c16cad |
parent 14032 | cef0c685fda8 |
child 14059 | 3185fb34f3b5 |
permissions | -rw-r--r-- |
14031 | 1 |
mod template_based; |
13913 | 2 |
|
13943
1fa905aa4cdb
move point struct into integral-geometry and use it to refactor a bit
alfadur
parents:
13913
diff
changeset
|
3 |
extern crate integral_geometry; |
14031 | 4 |
extern crate land2d; |
14056
8a0d69c16cad
Implement OutlinePoints for land generators, some ground work for template based landgen
unc0rr
parents:
14032
diff
changeset
|
5 |
extern crate itertools; |
14031 | 6 |
|
14032 | 7 |
pub struct LandGenerationParameters<T> { |
14031 | 8 |
zero: T, |
9 |
basic: T, |
|
10 |
} |
|
11 |
||
14032 | 12 |
pub trait LandGenerator { |
14031 | 13 |
fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>( |
14 |
&self, |
|
15 |
parameters: LandGenerationParameters<T>, |
|
16 |
random_numbers: &mut I, |
|
17 |
) -> land2d::Land2D<T>; |
|
18 |
} |
|
13943
1fa905aa4cdb
move point struct into integral-geometry and use it to refactor a bit
alfadur
parents:
13913
diff
changeset
|
19 |
|
13913 | 20 |
#[cfg(test)] |
21 |
mod tests { |
|
22 |
#[test] |
|
23 |
fn it_works() { |
|
24 |
assert_eq!(2 + 2, 4); |
|
25 |
} |
|
26 |
} |