2018-03-04 23:53:55 +08:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
2018-12-30 18:00:05 +08:00
|
|
|
using CustomNPCFramework.Framework.Enums;
|
|
|
|
using StardewValley;
|
2018-03-04 23:53:55 +08:00
|
|
|
|
|
|
|
namespace CustomNPCFramework.Framework
|
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Used as a class to hold all of the possible NPC names.</summary>
|
|
|
|
public class NpcNames
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Holds all of the NPC male names.</summary>
|
|
|
|
public static List<string> maleNames = new List<string>
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
|
|
|
"Freddy",
|
|
|
|
"Josh",
|
|
|
|
"Ash"
|
|
|
|
};
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Holds all of the NPC female names.</summary>
|
|
|
|
public static List<string> femaleNames = new List<string>
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
|
|
|
"Rebecca",
|
|
|
|
"Sierra",
|
|
|
|
"Lisa"
|
|
|
|
};
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Holds all of the NPC gender non-binary names.</summary>
|
|
|
|
public static List<string> otherGenderNames = new List<string>
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
|
|
|
"Jayden",
|
|
|
|
"Ryanne",
|
|
|
|
"Skylar"
|
|
|
|
};
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
/// <summary>Get a gender appropriate name from the pool of NPC names.</summary>
|
|
|
|
public static string getRandomNpcName(Genders gender)
|
2018-03-04 23:53:55 +08:00
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
if (gender == Genders.female)
|
|
|
|
{
|
2018-03-04 23:53:55 +08:00
|
|
|
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 "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|