protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string[] diceImgs = WebGame.findImgs(); dice[0] = new Die(diceImgs); dice[1] = new Die(diceImgs); dice[2] = new Die(diceImgs); dice[3] = new Die(diceImgs); dice[4] = new Die(diceImgs); buttonBehavior(); } }
protected void Score(object sender, CommandEventArgs e) { if (hasScoredThisRound) { return; } Button btn = (Button)sender; string test = e.CommandArgument.ToString(); PlacesToScore place; place = ConvertToPlacesFromString(test); Die[] newDice = dice; Side side = convertToSideFromPlace(place); if (side != Side.None) { } if (WebGame.Score(place, newDice)) { hasScoredThisRound = true; curRoll = 3; btn.Enabled = false; } if (curRound >= MAX_ROUNDS) { lblRound.Text = "Game Over!"; lblRoll.Text = ""; } setScoreboards(WebGame.upSb, WebGame.lwSb); }