complete, step before doing ai
This commit is contained in:
43
Program.cs
43
Program.cs
@@ -1,17 +1,44 @@
|
||||
namespace TicTacToe
|
||||
{
|
||||
internal static class Program
|
||||
public static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
public static Form1 form = new Form1();
|
||||
static Game game;
|
||||
static int wins = 0;
|
||||
static int loses = 0;
|
||||
|
||||
static void Main()
|
||||
{
|
||||
// To customize application configuration such as set high DPI settings or default font,
|
||||
// see https://aka.ms/applicationconfiguration.
|
||||
ApplicationConfiguration.Initialize();
|
||||
Application.Run(new Form1());
|
||||
game = new Game();
|
||||
game.Start();
|
||||
form.newGameToolStripMenuItem.Click += NewGame;
|
||||
form.exitToolStripMenuItem.Click += Exit;
|
||||
Application.Run(form);
|
||||
}
|
||||
|
||||
static void NewGame(object sender, EventArgs e)
|
||||
{
|
||||
game.Destroy();
|
||||
game = new Game();
|
||||
game.Start();
|
||||
}
|
||||
|
||||
static void Exit(object sender, EventArgs e)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
public static void AddLose()
|
||||
{
|
||||
loses += 1;
|
||||
form.lbl_loses.Text = "Antal F<>rluster: " + loses.ToString();
|
||||
}
|
||||
|
||||
public static void AddWin()
|
||||
{
|
||||
wins += 1;
|
||||
form.lbl_wins.Text = "Antal Vinster: " + wins.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user