mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Initial UI including ingredients in crafting modular components
This commit is contained in:
parent
085b18c07a
commit
a5a517916e
@ -666,6 +666,17 @@ impl ComponentRecipe {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn inputs(&self) -> impl ExactSizeIterator<Item = (&RecipeInput, u32)> {
|
||||||
|
let material = core::iter::once(&self.material);
|
||||||
|
let modifier = self.modifier.iter();
|
||||||
|
let additional_inputs = self.additional_inputs.iter();
|
||||||
|
material.chain(modifier.chain(additional_inputs))
|
||||||
|
.map(|(item_def, amount)| (item_def, *amount))
|
||||||
|
// Hack, not sure how to get exact size iterator from multiple chains.
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.into_iter()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Deserialize)]
|
#[derive(Clone, Deserialize)]
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user