Example #1
0
 public Boolean Attack(Orc anOrc)
 {
     if (myD20.Roll() >= 13)
     {
         return(hit(anOrc));
     }
     else
     {
         return(miss());
     }
 }
Example #2
0
        public void RollTest()
        {
            List <int> rollResults = new List <int>();
            IRollable  d           = DiceFactory.CreateD10();

            for (int i = 0; i < 100000000; i++)
            {
                rollResults.Add(d.Roll());
            }
            Assert.AreEqual(rollResults.Count, 100000000, "Count is " + rollResults.Count.ToString());
        }
Example #3
0
        public static List <int> SetUp1000000Results(this IRollable rollable)
        {
            var rollableResults = new List <int>();

            for (int i = 0; i < 1000000; i++)
            {
                int result = rollable.Roll();
                rollableResults.Add(result);
            }

            return(rollableResults);
        }
Example #4
0
 public void Run()
 {
     rollableTarget.Roll();
 }