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