using System.Collections.Generic; using System.Linq; using CustomNPCFramework.Framework.Enums; using StardewValley; namespace CustomNPCFramework.Framework { /// Used as a class to hold all of the possible NPC names. public class NpcNames { /// Holds all of the NPC male names. public static List maleNames = new List { "Freddy", "Josh", "Ash" }; /// Holds all of the NPC female names. public static List femaleNames = new List { "Rebecca", "Sierra", "Lisa" }; /// Holds all of the NPC gender non-binary names. public static List otherGenderNames = new List { "Jayden", "Ryanne", "Skylar" }; /// Get a gender appropriate name from the pool of NPC names. public static string getRandomNpcName(Genders gender) { if (gender == Genders.female) { int rand = Game1.random.Next(0, femaleNames.Count - 1); return femaleNames.ElementAt(rand); } if (gender == Genders.male) { int rand = Game1.random.Next(0, maleNames.Count - 1); return maleNames.ElementAt(rand); } if (gender == Genders.other) { int rand = Game1.random.Next(0, otherGenderNames.Count - 1); return otherGenderNames.ElementAt(rand); } return ""; } } }