Use correct types so builder_data example works.
This commit is contained in:
parent
66a470d669
commit
a49e9d019b
|
@ -12,9 +12,13 @@ struct MyData {
|
||||||
|
|
||||||
struct IncrementData;
|
struct IncrementData;
|
||||||
|
|
||||||
impl<D: Clone + Default> MapFilter<D> for IncrementData {
|
impl MapFilter<MyData> for IncrementData {
|
||||||
fn modify_map(&self, rng: &mut rand::prelude::StdRng, map: &mapgen::Map<D>) -> mapgen::Map<D> {
|
fn modify_map(
|
||||||
let map = map.clone();
|
&self,
|
||||||
|
_rng: &mut rand::prelude::StdRng,
|
||||||
|
map: &mapgen::Map<MyData>,
|
||||||
|
) -> mapgen::Map<MyData> {
|
||||||
|
let mut map = map.clone();
|
||||||
map.data.value += 1;
|
map.data.value += 1;
|
||||||
map
|
map
|
||||||
}
|
}
|
||||||
|
@ -29,5 +33,5 @@ fn main() {
|
||||||
.with(Box::new(IncrementData))
|
.with(Box::new(IncrementData))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
println!("{:}", &map);
|
println!("{:}\n{}", map, map.data.value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user