/// <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); } }
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(); } }