コード例 #1
0
 public WeightedSimHash GetOneWeightedSimHash(string item, SeededRandom rnd)
 {
     if (ElementChoiceGroups.ContainsKey(item))
     {
         return(WeightedRandom.Choose(ElementChoiceGroups[item].choices, rnd));
     }
     Debug.LogError("Couldnt get SimHash [" + item + "]");
     return(null);
 }
コード例 #2
0
        public WeightedMob GetNextMob(SeededRandom rnd)
        {
            WeightedMob result = null;

            switch (mobselection)
            {
            case Selection.Weighted:
                result = WeightedRandom.Choose(mobs, rnd);
                break;

            case Selection.OneOfEach:
            case Selection.WeightedBucket:
                if (mobIter.MoveNext())
                {
                    result = mobIter.Current;
                }
                break;
            }
            return(result);
        }