public string GetRole(double x) { if (roles == null) { roles = new WeightedChoiceSet(Roles); } return(roles.Match(x)); }
public string GetRace() { if (races == null) { races = new WeightedChoiceSet(Races); } var roll = r.NextDouble(); return(races.Match(roll)); }
public string GetGender() { if (genders == null) { genders = new WeightedChoiceSet(Gender); } var roll = r.NextDouble(); return(genders.Match(roll)); }
public string GetSubrace() { if (subraces == null) { subraces = new WeightedChoiceSet(Subrace); } if (Subrace.Count == 0) { return(""); } var roll = r.NextDouble(); var subrace = subraces.Match(roll); return(subrace == "N/A"? "": subrace); }