Beispiel #1
0
 private void Exit_Click(object sender, RoutedEventArgs e)
 {
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.DoExit, arg = false
     });
 }
Beispiel #2
0
 private void BtnConnect_Click(object sender, RoutedEventArgs e)
 {
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.GoConnect
     });
 }
Beispiel #3
0
 private void BtnNew_Click(object sender, RoutedEventArgs e)
 {
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.DoLoad, arg = new SaveGame(new CoinType[BoardSize + 1][], CoinType.Red, new Size(BoardSize + 1, BoardSize), "default")
     });
 }
Beispiel #4
0
 private void View_GameSelected(object sender, SaveGame e)
 {
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.DoLoad, arg = e
     });
 }
 private void GameConnection_GameConnected(object sender, EventArgs e)
 {
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.GoGame
     });
 }
Beispiel #6
0
 /// <summary>
 /// Turns off the AFK AI.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void BtnAIOff_Click(object sender, RoutedEventArgs e)
 {
     BtnAIOn.IsEnabled  = true;
     BtnAIOff.IsEnabled = false;
     NewGameMessage?.Invoke(this, new GameMessage()
     {
         operation = GameOperation.DoSetAI, arg = false
     });
 }
Beispiel #7
0
        /// <summary>
        /// Saves the game with user choice for the name and exits the current game.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveNExit_Click(object sender, RoutedEventArgs e)
        {
            AskSaveName askName = new AskSaveName();

            askName.ShowDialog();
            if (askName.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                NewGameMessage?.Invoke(this, new GameMessage()
                {
                    operation = GameOperation.DoSave, arg = askName.NameText
                });
                NewGameMessage?.Invoke(this, new GameMessage()
                {
                    operation = GameOperation.DoExit, arg = false
                });
            }
        }