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