equal
deleted
inserted
replaced
8 |
8 |
9 pub struct LandGenerationParameters<T> { |
9 pub struct LandGenerationParameters<T> { |
10 zero: T, |
10 zero: T, |
11 basic: T, |
11 basic: T, |
12 distance_divisor: u32, |
12 distance_divisor: u32, |
|
13 skip_distort: bool, |
|
14 skip_bezier: bool, |
13 } |
15 } |
14 |
16 |
15 impl<T: Copy + PartialEq> LandGenerationParameters<T> { |
17 impl<T: Copy + PartialEq> LandGenerationParameters<T> { |
16 pub fn new(zero: T, basic: T) -> Self { |
18 pub fn new(zero: T, basic: T, distance_divisor: u32, skip_distort: bool, skip_bezier: bool) -> Self { |
17 Self { |
19 Self { |
18 zero, |
20 zero, |
19 basic, |
21 basic, |
20 distance_divisor: 1, |
22 distance_divisor, |
|
23 skip_distort, |
|
24 skip_bezier, |
21 } |
25 } |
22 } |
26 } |
23 } |
27 } |
24 |
28 |
25 pub trait LandGenerator { |
29 pub trait LandGenerator { |
26 fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>( |
30 fn generate_land<T: Copy + PartialEq, I: Iterator<Item = u32>>( |
27 &self, |
31 &self, |
28 parameters: LandGenerationParameters<T>, |
32 parameters: &LandGenerationParameters<T>, |
29 random_numbers: &mut I, |
33 random_numbers: &mut I, |
30 ) -> land2d::Land2D<T>; |
34 ) -> land2d::Land2D<T>; |
31 } |
35 } |
32 |
36 |
33 #[cfg(test)] |
37 #[cfg(test)] |