Пример #1
0
        /// <summary>
        /// First make all dice invisible, then make specified amount visible.
        /// </summary>
        /// <param name="numberOfDiceVisible">The number of dice to display to the user.</param>
        public void SetDiceVisibility(int numberOfDiceVisible)
        {
            foreach (Die die in diceList)
            {
                die.SetVisible(false);
            }

            for (int i = 0; i < numberOfDiceVisible; i++)
            {
                Die die = diceList[i];
                die.SetVisible(true);
            }
        }
Пример #2
0
        private void ConfigureDice()
        {
            for (int i = 1; i <= 6; i++)
            {
                string    imgId           = "img_die" + i;
                int       imageResourceId = Resources.GetIdentifier(imgId, "id", PackageName);
                ImageView imgView         = (ImageView)FindViewById(imageResourceId);

                Die die = new Die(imgView, Dice.CurrentDieColor);
                die.SetVisible(true);
                dice.AddDieToArray(die);
                dice.RollDice();
            }
        }