コード例 #1
0
ファイル: PigTurn.cs プロジェクト: nwilli27/WilliamsGameOfPig
        /// <summary>
        /// Handles the functionality for a dice roll.
        /// Deals with assigning random values 1-6 &
        /// adding the roll if it doesn't have a 1.
        /// </summary>
        /// <returns>The roll that was created.</returns>
        public PigRoll RollDice()
        {
            var currentRoll = new PigRoll();

            currentRoll.RandomlyAssignDice();

            if (!currentRoll.HasAOne)
            {
                this.Rolls.Add(currentRoll);
            }

            return(currentRoll);
        }
コード例 #2
0
 private void setCurrentDice(PigRoll currentRoll)
 {
     this.CurrentDiceOne = currentRoll.DiceOne;
     this.CurrentDiceTwo = currentRoll.DiceTwo;
 }