using System.Collections.Generic; using System.Linq; using Godot; public class ResourceDistributor { public static List resourceNames = new() { "Iron ore", "Stone", "Copper ore", "Spiderweb", "Mushroom", "Tin ore" }; public static string GetResource(List current) { List diff = resourceNames.Except(current).ToList(); if (diff.Count <= 0) { return resourceNames[GameData.rand.Next(resourceNames.Count)]; } else { return diff[GameData.rand.Next(diff.Count)]; } } }