protected void Page_Load(object sender, EventArgs e) { if (Session["game"] == null) { Session["game"] = new TicTacToeLogic(); } }
protected void ButtonNewGame_Click(object sender, EventArgs e) { LiteralResult.Text = ""; Session["game"] = new TicTacToeLogic(); this.Button1_1.Enabled = true; this.Button1_2.Enabled = true; this.Button1_3.Enabled = true; this.Button2_1.Enabled = true; this.Button2_2.Enabled = true; this.Button2_3.Enabled = true; this.Button3_1.Enabled = true; this.Button3_2.Enabled = true; this.Button3_3.Enabled = true; UpdateGameData(); }
private void ComputerWins() { LiteralResult.Text = "You loose!"; Session["game"] = new TicTacToeLogic(); UpdateGameData(); }
private void PlayerWins() { LiteralResult.Text = "You win!"; Session["game"] = new TicTacToeLogic(); UpdateGameData(); }