コード例 #1
0
ファイル: Random.cs プロジェクト: mp1011/Simple2DGame
        public bool GetNext()
        {
            if (resultsBeforeNextTrue <= 0)
            {
                resultsBeforeNextTrue = MinMax.RandomValue();
                return(true);
            }

            resultsBeforeNextTrue--;
            return(false);
        }
コード例 #2
0
ファイル: Random.cs プロジェクト: mp1011/Simple2DGame
 public RandomChance(int min, int max)
 {
     MinMax = new BoundedInteger(min, max);
     resultsBeforeNextTrue = MinMax.RandomValue();
 }