예제 #1
0
 public static int Throws(Dice dice, 
                          int nThrows = 1, 
                          CountingMethod countingMethod = null, 
                          ThrowModifier mod = ThrowModifier.Normal)
 {
     return Throws(dice.NumFaces, dice.NumDice, nThrows, countingMethod, mod);
 }
예제 #2
0
 public static int Throws(Dice dice,
                          int nThrows = 1,
                          CountingMethod countingMethod = null,
                          ThrowModifier mod             = ThrowModifier.Normal)
 {
     return(Throws(dice.NumFaces, dice.NumDice, nThrows, countingMethod, mod));
 }
예제 #3
0
 public static int Throws(int nFaces, int nDice = 1, int nThrows = 1, CountingMethod countingMethod = null, ThrowModifier mod = ThrowModifier.Normal)
 {
     switch(mod)
     {
         case ThrowModifier.Minimized:
             return nDice * nThrows;
         case ThrowModifier.Maximized:
             return nFaces * nDice * nThrows;
         case ThrowModifier.Averaged:
             return (int)Math.Floor((((nDice * nThrows) * (1 + nFaces)) / 2.0) * nThrows);
         case ThrowModifier.Normal:
         default:
             return Throws(nFaces, nDice, nThrows, countingMethod);
     }
 }
예제 #4
0
        public static int Throws(int nFaces, int nDice = 1, int nThrows = 1, CountingMethod countingMethod = null, ThrowModifier mod = ThrowModifier.Normal)
        {
            switch (mod)
            {
            case ThrowModifier.Minimized:
                return(nDice * nThrows);

            case ThrowModifier.Maximized:
                return(nFaces * nDice * nThrows);

            case ThrowModifier.Averaged:
                return((int)Math.Floor((((nDice * nThrows) * (1 + nFaces)) / 2.0) * nThrows));

            case ThrowModifier.Normal:
            default:
                return(Throws(nFaces, nDice, nThrows, countingMethod));
            }
        }