author | Wuzzy <Wuzzy2@mail.ru> |
Sun, 07 Apr 2019 19:26:16 +0200 | |
changeset 14755 | ab7bf5036314 |
parent 14212 | bb2f301d4fe0 |
permissions | -rw-r--r-- |
14105 | 1 |
mod outline; |
14074 | 2 |
pub mod outline_template; |
14105 | 3 |
pub mod template_based; |
13913 | 4 |
|
14032 | 5 |
pub struct LandGenerationParameters<T> { |
14031 | 6 |
zero: T, |
7 |
basic: T, |
|
14105 | 8 |
distance_divisor: u32, |
14126 | 9 |
skip_distort: bool, |
10 |
skip_bezier: bool, |
|
14031 | 11 |
} |
12 |
||
14105 | 13 |
impl<T: Copy + PartialEq> LandGenerationParameters<T> { |
14126 | 14 |
pub fn new(zero: T, basic: T, distance_divisor: u32, skip_distort: bool, skip_bezier: bool) -> Self { |
14105 | 15 |
Self { |
16 |
zero, |
|
17 |
basic, |
|
14126 | 18 |
distance_divisor, |
19 |
skip_distort, |
|
20 |
skip_bezier, |
|
14105 | 21 |
} |
14059
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14056
diff
changeset
|
22 |
} |
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14056
diff
changeset
|
23 |
} |
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14056
diff
changeset
|
24 |
|
14032 | 25 |
pub trait LandGenerator { |
14031 | 26 |
fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>( |
27 |
&self, |
|
14126 | 28 |
parameters: &LandGenerationParameters<T>, |
14031 | 29 |
random_numbers: &mut I, |
30 |
) -> land2d::Land2D<T>; |
|
31 |
} |
|
13943
1fa905aa4cdb
move point struct into integral-geometry and use it to refactor a bit
alfadur
parents:
13913
diff
changeset
|
32 |
|
13913 | 33 |
#[cfg(test)] |
34 |
mod tests { |
|
35 |
#[test] |
|
36 |
fn it_works() { |
|
37 |
assert_eq!(2 + 2, 4); |
|
38 |
} |
|
39 |
} |