示例#1
0
 public string GetRole(double x)
 {
     if (roles == null)
     {
         roles = new WeightedChoiceSet(Roles);
     }
     return(roles.Match(x));
 }
示例#2
0
        public string GetRace()
        {
            if (races == null)
            {
                races = new WeightedChoiceSet(Races);
            }
            var roll = r.NextDouble();

            return(races.Match(roll));
        }
示例#3
0
        public string GetGender()
        {
            if (genders == null)
            {
                genders = new WeightedChoiceSet(Gender);
            }
            var roll = r.NextDouble();

            return(genders.Match(roll));
        }
示例#4
0
        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);
        }