コード例 #1
0
        public void NewGame()
        {
            FormSettings formSettings = new FormSettings();

            formSettings.ShowDialog();

            m_BoardSize = formSettings.BoardSize;
            m_PlayerOne = new Player(formSettings.PlayerOneName);
            m_PlayerTwo = new Player(formSettings.PlayerTwoName, formSettings.IsComputer);

            r_GameHandler.Init(m_PlayerOne, m_PlayerTwo, (byte)m_BoardSize);
            m_Tiles = new Tile[(byte)m_BoardSize, (byte)m_BoardSize];

            if (m_FormGame == null)
            {
                m_FormGame = new FormGame();
                initBoard();
                m_FormGame.ShowDialog();
            }
        }
コード例 #2
0
ファイル: Game.xaml.cs プロジェクト: Honza-Bota/Dama
        public void Info()
        {
            FormGame.labelHrac1veHre.Content    = Reds.Count;
            FormGame.labelHrac2veHre.Content    = Blues.Count;
            FormGame.labelHrac1vyrazeno.Content = 12 - Reds.Count;
            FormGame.labelHrac2vyrazeno.Content = 12 - Blues.Count;

            if (Reds.Count == 0)
            {
                MessageBox.Show("Vyhrál modrý!!", "Výhra", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);

                MainWindow Lobby = new MainWindow();
                Lobby.Show();
                FormGame.Close();
            }
            else if (Blues.Count == 0)
            {
                MessageBox.Show("Vyhrál červený!!", "Výhra", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);

                MainWindow Lobby = new MainWindow();
                Lobby.Show();
                FormGame.Close();
            }
        }
コード例 #3
0
      private void StartGame_Click(object sender, EventArgs e)
      {
          FormGame f2 = new FormGame();

          f2.ShowDialog();
      }