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

            return(races.Match(r));
        }