public void Begin(List <Player> players) { Dice = new List <DiceD6>(); for (int i = 1; i <= DiceSelectionMenu._diceCount; i++) { DiceD6 dice = new DiceD6(); Dice.Add(dice); } Debug.Assert(Players != null && Players.Count >= 2); Debug.Assert(Dice != null && Dice.Count > 0); for (int i = 1; i <= DiceSelectionMenu._diceCount; i++) { foreach (Player p in players) { Console.WriteLine("Player " + p.CountOfPlayers + "(" + p.Name + ") " + "roll... (Press enter to roll)"); Console.ReadLine(); Console.WriteLine("Player " + p.CountOfPlayers + "(" + p.Name + ") " + "rolled a " + p.RollDice() + Environment.NewLine); } } GetWinner(); Console.ReadKey(); GameOverMenu _gameOverController = new GameOverMenu(); _gameOverController.Render(); CheckMenu(); }
/// <summary> /// Dices animation without summa /// </summary> public void RollingDiceAnimation() { _dices.ForEach(dice => { if (_diceType == typeof(DiceD6)) { DiceD6 diceD6 = dice as DiceD6; diceD6.Value = _rnd.Next(1, DiceD6.DICE_MAX_WALL + 1); } }); }
/// <summary> /// Roll dices and get value all dices /// </summary> public void RollDice() { _dices.ForEach(dice => { if (_diceType == typeof(DiceD6)) { DiceD6 diceD6 = dice as DiceD6; _sumaDices += diceD6.Value = _rnd.Next(1, DiceD6.DICE_MAX_WALL + 1); } }); }