Cleaned up project with better structure.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
|
||||
public class CraftNode : ProgramNode
|
||||
@@ -16,11 +15,13 @@ public class CraftNode : ProgramNode
|
||||
lastExecutionMessage = "No Item selected";
|
||||
return NodeResult.FAILURE;
|
||||
}
|
||||
|
||||
if (amount <= 0)
|
||||
{
|
||||
lastExecutionMessage = "Amount has to be atleast 1";
|
||||
return NodeResult.FAILURE;
|
||||
}
|
||||
|
||||
if (!GameData.inventory.CanCraft(selectedItem.data.Inputs, amount))
|
||||
{
|
||||
lastExecutionMessage = "Not enough items to craft this";
|
||||
@@ -67,12 +68,13 @@ public class CraftNode : ProgramNode
|
||||
options.AddItem("Select item...");
|
||||
foreach (ItemData item in GameData.availableItems.Values)
|
||||
{
|
||||
if(GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
if (GameData.availableResearch[item.Research].state != ResearchState.RESEARCHED) continue;
|
||||
if (item.Inputs.Count > 0)
|
||||
{
|
||||
options.AddItem(item.GetCraftingDisplay());
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedItem != null)
|
||||
{
|
||||
for (int i = 0; i < options.ItemCount; i++)
|
||||
|
||||
Reference in New Issue
Block a user