/// <summary>
 /// Displays the ai players result.
 /// </summary>
 public void DisplayAIPlayersResult(List <Player> aiPlayers)
 {
     Console.Write($"AI player hands are:{Environment.NewLine}");
     foreach (var player in aiPlayers)
     {
         var handNameDescription = GenericEnumHelper.GetEnumDescription <PokerHandEnum>(player.Hand.HandName);
         Console.Write($"{player.Name} hand is: {handNameDescription} {Environment.NewLine}");
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the enum description in sequence.
        /// </summary>
        /// <returns></returns>
        private string GetEnumDescriptionInSequence()
        {
            var result = new StringBuilder();

            foreach (PokerDiceEnum eachEnum in Enum.GetValues(typeof(PokerDiceEnum)))
            {
                result.Append(GenericEnumHelper.GetEnumDescription <PokerDiceEnum>(eachEnum.ToString()));
            }
            return(result.ToString());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Rolls the dice.
        /// </summary>
        /// <returns></returns>
        public DiceResult RollDice()
        {
            var diceResult        = new DiceResult();
            var dieResult         = new StringBuilder();
            var previousDieResult = string.Empty;

            for (var i = 0; i < 5; i++)
            {
                //get random dice description
                var randomDieResult =
                    GenericEnumHelper.GetEnumDescription <PokerDiceEnum>(GenericRandomPicker
                                                                         .RandomEnumValue <PokerDiceEnum>().ToString());
                AddDiceResultToList(diceResult, randomDieResult, previousDieResult);
                diceResult.Result = dieResult.Append(randomDieResult).ToString();
                previousDieResult = randomDieResult;
            }
            diceResult.Result = dieResult.ToString();
            return(diceResult);
        }