Merge pull request #1 from LinlyBoi/Mjorks-Forsaken-Creations

Created node to exist.
This commit is contained in:
Linly
2022-06-01 17:05:16 +02:00
committed by GitHub
2 changed files with 27 additions and 3 deletions

2
.idea/vcs.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,3 +1,27 @@
public class RecipeNode
{
public class RecipeNode {
private String ingredient; // Ingredient's name
private double portion; // Portion size of ingredient
RecipeNode pointer; // To point at parent node
// Accessors and Mutators for fields (Except pointer's)
RecipeNode(String ingredient, double portion) {
this.ingredient = ingredient;
this.portion = portion;
}
public void setIngredient(String ingredient) {
this.ingredient = ingredient;
}
public String getIngredient() {
return ingredient;
}
public void setPortion(double portion) {
this.portion = portion;
}
public double getPortion() {
return portion;
}
}