void start_game() { GamemodeChoose gamemodeChoose = new GamemodeChoose(); gamemodeChoose.ShowDialog(); switch (gamemodeChoose.gamemode) { case 1: program = new Program();//Create the bridge, the bridge will create a Gameboard rightButton.Content = "RESET"; leftButton.Content = "UNDO"; update_gameboard(); break; case 2: networkProgram = new NetworkProgram(); rightButton.Visibility = Visibility.Hidden; leftButton.Visibility = Visibility.Hidden; networkTimer.Elapsed += NetworkTimerTask; networkTimer.Enabled = true; networkTimer.AutoReset = true; networkTimer.Start(); update_network_gameboard(); break; case 3: program = new AIProgram(); rightButton.Content = "RESET"; leftButton.Content = "UNDO"; update_gameboard(); break; } gamemodeChoose.Close(); }
public NetworkSetting(object networkProgram) { this.ResizeMode = ResizeMode.NoResize; this.Title = "Online room settings"; this.Icon = BitmapFrame.Create(new Uri("pack://*****:*****@"pack://application:,,,/src/img/3button.png"))); this.networkProgram = (NetworkProgram)networkProgram; this.Closing += NetworkSetting_Closing; InitializeComponent(); }