Beispiel #1
0
        public DiceRollCollection PerformRolls(int amountOfRolls)
        {
            DiceRollCollection toReturn = new DiceRollCollection();
            Random             rnd      = new Random();

            for (int i = 0; i < amountOfRolls; i++)
            {
                DiceRoll diceRoll  = new DiceRoll();
                int      rndNumber = rnd.Next(0, Dice.Sides.Length - 1);
                diceRoll.NumberRolled = Dice.Sides[rndNumber];
                toReturn.DiceRolls.Add(diceRoll);
                toReturn.RollsHorisontallyAsString += diceRoll.NumberRolled + " ,";
            }
            DiceRolls.Add(toReturn);
            toReturn.TimeRollWasPerformed = DateTime.Now;
            return(toReturn);
        }
Beispiel #2
0
 public bool RemoveDiceRollArray(DiceRollCollection diceRolls)
 {
     DiceRolls.Remove(diceRolls);
     return(true);
 }
Beispiel #3
0
 public DiceRollCollection AddDiceRolls(DiceRollCollection diceRolls)
 {
     DiceRolls.Add(diceRolls);
     return(diceRolls);
 }