29 lines
641 B
C#
29 lines
641 B
C#
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)];
|
|
}
|
|
}
|
|
} |