|
|
@@ -9,9 +9,10 @@ import org.leumasjaffe.observer.Observable;
|
|
|
|
|
|
import lombok.Data;
|
|
|
import lombok.EqualsAndHashCode;
|
|
|
+import lombok.NonNull;
|
|
|
|
|
|
@Data @EqualsAndHashCode(callSuper=false)
|
|
|
-public class Card extends Observable.Instance implements CompoundRecipeComponent {
|
|
|
+public class Card extends Observable.Instance implements CompoundRecipeComponent {
|
|
|
int id = 0; // TODO Fix this
|
|
|
int[] dependsOn = {}; // decltype(id)[]
|
|
|
String vessel = "";
|
|
|
@@ -24,10 +25,10 @@ public class Card extends Observable.Instance implements CompoundRecipeComponent
|
|
|
}
|
|
|
|
|
|
public Stream<? extends RecipeComponent> getComponents() {
|
|
|
- if (preparation.isPresent()) {
|
|
|
- return Stream.of(preparation.get());
|
|
|
- } else {
|
|
|
- return cooking.stream();
|
|
|
- }
|
|
|
+ return cooking.stream();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setPreparation(final @NonNull Preparation p) {
|
|
|
+ preparation = Optional.of(new Preparation(p.duration, this::getIngredients));
|
|
|
}
|
|
|
}
|