Recipe: richer Output
This commit is contained in:
parent
f28aeaf321
commit
af053c33b7
1 changed files with 16 additions and 1 deletions
|
|
@ -19,6 +19,21 @@ pub struct Input {
|
|||
amount: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
pub struct Output {
|
||||
/// Each output has either a `quantity` (for discrete things, like
|
||||
/// apples or bearings) or an `amount` (for continuous things,
|
||||
/// like rope or flour).
|
||||
///
|
||||
/// FIXME: Is there a good way to handle the "units" of the
|
||||
/// quantity/amount? Maybe the units could default to "count", but
|
||||
/// be optionally overridden by the recipe to things like "meters"
|
||||
/// (of tubing) or "grams" (of chromic acid). Then this struct
|
||||
/// would be `quantity: usize, units: Option<Unit>`.
|
||||
quantity: Option<usize>,
|
||||
amount: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize)]
|
||||
pub struct Operator {
|
||||
skills: Vec<String>,
|
||||
|
|
@ -51,7 +66,7 @@ pub struct Recipe {
|
|||
/// FIXME: Or is that always the case, and we should have no outputs
|
||||
/// section? None of the recipes we've been doodling around with
|
||||
/// have anything like byproducts or waste streams...
|
||||
outputs: Option<Vec<String>>,
|
||||
outputs: Option<std::collections::HashMap<String, Output>>,
|
||||
}
|
||||
|
||||
impl Recipe {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue