author | Grigory Ustinov <grenka@altlinux.org> |
Wed, 25 Sep 2019 21:03:59 +0300 | |
changeset 15418 | 36c263a6141d |
parent 14207 | bb2f301d4fe0 |
child 15828 | 44b49f255e31 |
permissions | -rw-r--r-- |
14100 | 1 |
mod outline; |
14069 | 2 |
pub mod outline_template; |
14100 | 3 |
pub mod template_based; |
13908 | 4 |
|
14027 | 5 |
pub struct LandGenerationParameters<T> { |
14026 | 6 |
zero: T, |
7 |
basic: T, |
|
14100 | 8 |
distance_divisor: u32, |
14121 | 9 |
skip_distort: bool, |
10 |
skip_bezier: bool, |
|
14026 | 11 |
} |
12 |
||
14100 | 13 |
impl<T: Copy + PartialEq> LandGenerationParameters<T> { |
14121 | 14 |
pub fn new(zero: T, basic: T, distance_divisor: u32, skip_distort: bool, skip_bezier: bool) -> Self { |
14100 | 15 |
Self { |
16 |
zero, |
|
17 |
basic, |
|
14121 | 18 |
distance_divisor, |
19 |
skip_distort, |
|
20 |
skip_bezier, |
|
14100 | 21 |
} |
14054
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14051
diff
changeset
|
22 |
} |
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14051
diff
changeset
|
23 |
} |
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14051
diff
changeset
|
24 |
|
14027 | 25 |
pub trait LandGenerator { |
14026 | 26 |
fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>( |
27 |
&self, |
|
14121 | 28 |
parameters: &LandGenerationParameters<T>, |
14026 | 29 |
random_numbers: &mut I, |
30 |
) -> land2d::Land2D<T>; |
|
31 |
} |
|
13938
1fa905aa4cdb
move point struct into integral-geometry and use it to refactor a bit
alfadur
parents:
13908
diff
changeset
|
32 |
|
13908 | 33 |
#[cfg(test)] |
34 |
mod tests { |
|
35 |
#[test] |
|
36 |
fn it_works() { |
|
37 |
assert_eq!(2 + 2, 4); |
|
38 |
} |
|
39 |
} |