pog champ pog champs
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@@ -130,19 +130,37 @@ public class RecipeTree
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void actionAdd(RecipeNode actionNchild) {
|
// public void actionAdd(RecipeNode root,RecipeNode actionNchild) {
|
||||||
|
// if(root == null) {
|
||||||
|
// this.root = actionNchild;
|
||||||
|
// } else {
|
||||||
|
// for(RecipeNode node : root.getChildren()) {
|
||||||
|
// if(node.getPortion() != 0 || !actionNchild.getIngredient().equals(node.getIngredient())) {
|
||||||
|
// actionAdd(node,actionNchild);
|
||||||
|
// } else if(node.getPortion() == 0 && actionNchild.getIngredient().equals(node.getIngredient())) {
|
||||||
|
// addNode(node, actionNchild);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
public void actionAdd(RecipeNode root,RecipeNode actionNchild) {
|
||||||
if(root == null) {
|
if(root == null) {
|
||||||
root = actionNchild;
|
this.root = actionNchild;
|
||||||
} else {
|
} else {
|
||||||
for(RecipeNode node : root.children) {
|
for(RecipeNode node : root.getChildren()) {
|
||||||
if(node.getPortion() != 0 || !actionNchild.getIngredient().equals(node.getIngredient())) {
|
if(node.getPortion() == 0 && node.getChildren() != null)
|
||||||
actionAdd(actionNchild);
|
actionAdd(node,actionNchild);
|
||||||
} else if(node.getPortion() == 0 && actionNchild.getIngredient().equals(node.getIngredient())) {
|
else
|
||||||
actionNchild.parent = node.parent;
|
addNode(node,actionNchild);
|
||||||
node.parent = actionNchild;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
public void actionAdd(RecipeNode actionNchild)
|
||||||
|
{
|
||||||
|
actionAdd(root, actionNchild);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user