Added resources to the game and prepared scripts for later usage
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Godot;
|
||||
|
||||
public class ResourceDistributor
|
||||
{
|
||||
public static List<string> resourceNames = new()
|
||||
{
|
||||
"Iron ore",
|
||||
"Stone",
|
||||
"Copper ore",
|
||||
"Spiderweb",
|
||||
"Mushroom",
|
||||
"Tin ore"
|
||||
};
|
||||
|
||||
public static string GetResource(List<string> current)
|
||||
{
|
||||
List<string> diff = resourceNames.Except(current).ToList();
|
||||
if (diff.Count <= 0)
|
||||
{
|
||||
return resourceNames[GameData.rand.Next(resourceNames.Count)];
|
||||
}
|
||||
else
|
||||
{
|
||||
return diff[GameData.rand.Next(diff.Count)];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user