Initial model + some various changes
This commit is contained in:
parent
a080d19cb9
commit
108476e355
17 changed files with 1070 additions and 1286 deletions
|
|
@ -1,10 +1,14 @@
|
|||
struct Recipe {
|
||||
ingredients: Vec<Ingredient>,
|
||||
process: Vec<Group>,
|
||||
title: String,
|
||||
estimate_time: Option<i32>, // [min].
|
||||
difficulty: Option<Difficulty>,
|
||||
|
||||
//ingredients: Vec<Ingredient>, // For four people.
|
||||
process: Vec<Group>,
|
||||
}
|
||||
|
||||
struct Ingredient {
|
||||
quantity: Quantity,
|
||||
quantity: Option<Quantity>,
|
||||
name: String,
|
||||
}
|
||||
|
||||
|
|
@ -12,15 +16,16 @@ struct Quantity {
|
|||
value: f32,
|
||||
unit: String,
|
||||
}
|
||||
|
||||
struct Group {
|
||||
name: String,
|
||||
name: Option<String>,
|
||||
steps: Vec<Step>,
|
||||
}
|
||||
|
||||
struct Step {
|
||||
action: String,
|
||||
input: Vec<StepInput>,
|
||||
output: Vec<IntermediateSubstance>,
|
||||
action: String,
|
||||
input: Vec<StepInput>,
|
||||
output: Vec<IntermediateSubstance>,
|
||||
}
|
||||
|
||||
struct IntermediateSubstance {
|
||||
|
|
@ -30,5 +35,12 @@ struct IntermediateSubstance {
|
|||
|
||||
enum StepInput {
|
||||
Ingredient(Ingredient),
|
||||
IntermediateSubstance,
|
||||
}
|
||||
IntermediateSubstance(IntermediateSubstance),
|
||||
}
|
||||
|
||||
enum Difficulty {
|
||||
Unknown,
|
||||
Easy,
|
||||
Medium,
|
||||
Hard,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue