Big project cleanup with overhaul of file responsibilities (KISS) and code (DRY, YAGNI)

This commit is contained in:
2026-05-14 11:17:02 +02:00
parent bd6cdeb97b
commit 300c8f5a42
54 changed files with 2030 additions and 1745 deletions
+3 -17
View File
@@ -9,11 +9,12 @@ public class ForNode : ProgramNode
{
DisplayText = "For";
}
public override NodeResult Execute(Robot robot, double delta)
{
bool isConditionFulfilled = DetermineCondition();
amountExecuted++;
return isConditionFulfilled? NodeResult.SUCCESS : NodeResult.CONDITIONFALSE;
return isConditionFulfilled ? NodeResult.SUCCESS : NodeResult.CONDITIONFALSE;
}
private bool DetermineCondition()
@@ -41,21 +42,6 @@ public class ForNode : ProgramNode
Dictionary<StringName, ProgramNode> availableNodes
)
{
nextNode = null;
NegativeNode = null;
foreach (Godot.Collections.Dictionary connection in connections)
{
int port = (int)connection["from_port"];
ProgramNode connectedNode = GetConnectedNode(connection, availableNodes);
if (port == 0)
{
nextNode = connectedNode;
}
else
{
NegativeNode = connectedNode;
}
}
SetBranchNodes(connections, availableNodes);
}
}