author | unC0Rr |
Mon, 30 Jan 2023 15:50:14 +0100 | |
branch | transitional_engine |
changeset 15942 | 6e22f4390b7e |
parent 15934 | 022ec6b916b7 |
child 15951 | 5f00829c55ec |
permissions | -rw-r--r-- |
14121 | 1 |
mod outline; |
14090 | 2 |
pub mod outline_template; |
14121 | 3 |
pub mod template_based; |
15942 | 4 |
pub mod wavefront_collapse; |
13929 | 5 |
|
15934
022ec6b916b7
Split generation and painting phases, paint by old engine, use template filters
unC0Rr
parents:
15932
diff
changeset
|
6 |
#[derive(Clone, Copy)] |
14048 | 7 |
pub struct LandGenerationParameters<T> { |
14047 | 8 |
zero: T, |
9 |
basic: T, |
|
14121 | 10 |
distance_divisor: u32, |
14142 | 11 |
skip_distort: bool, |
12 |
skip_bezier: bool, |
|
14047 | 13 |
} |
14 |
||
15942 | 15 |
impl<T: Copy + PartialEq + Default> LandGenerationParameters<T> { |
15850 | 16 |
pub fn new( |
17 |
zero: T, |
|
18 |
basic: T, |
|
19 |
distance_divisor: u32, |
|
20 |
skip_distort: bool, |
|
21 |
skip_bezier: bool, |
|
22 |
) -> Self { |
|
14121 | 23 |
Self { |
24 |
zero, |
|
25 |
basic, |
|
14142 | 26 |
distance_divisor, |
27 |
skip_distort, |
|
28 |
skip_bezier, |
|
14121 | 29 |
} |
14075
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14072
diff
changeset
|
30 |
} |
15932
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
31 |
|
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
32 |
pub fn zero(&self) -> T { |
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
33 |
self.zero |
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
34 |
} |
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
35 |
|
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
36 |
pub fn basic(&self) -> T { |
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
37 |
self.basic |
230dc46487ea
Update mapgen to take into account actual values for 'zero' and 'basic' colors
unC0Rr
parents:
15850
diff
changeset
|
38 |
} |
14075
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14072
diff
changeset
|
39 |
} |
3185fb34f3b5
update theme editor to use new land generator implementation
alfadur
parents:
14072
diff
changeset
|
40 |
|
14048 | 41 |
pub trait LandGenerator { |
15942 | 42 |
fn generate_land<T: Copy + PartialEq + Default, I: Iterator<Item = u32>>( |
14047 | 43 |
&self, |
14142 | 44 |
parameters: &LandGenerationParameters<T>, |
14047 | 45 |
random_numbers: &mut I, |
46 |
) -> land2d::Land2D<T>; |
|
47 |
} |