21 lines
567 B
C#
21 lines
567 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Godot;
|
|
|
|
public class ResourceDistributor
|
|
{
|
|
public static Dictionary<string, Texture2D> resources = ResourceLoader.LoadResourceSymbols();
|
|
|
|
public static string GetResource(List<string> current)
|
|
{
|
|
List<string> diff = resources.Keys.Except(current).ToList();
|
|
if (diff.Count <= 0)
|
|
{
|
|
return resources.Keys.ToList()[GameData.rand.Next(resources.Keys.Count)];
|
|
}
|
|
else
|
|
{
|
|
return diff[GameData.rand.Next(diff.Count)];
|
|
}
|
|
}
|
|
} |