예제 #1
0
 private void CreateHSWindowAndLoadIt(PlayerEntity player, string player2, string wintext)
 {
     if (!is_created)
     {
         is_created = true;
         HighscoresWindow hs = new HighscoresWindow(wintext, player, player.PlayerName, player2, player.DestroyedShips.Count.ToString(), player.RemainingShips.Count.ToString(), player.PlayerHits.Count.ToString(), player.EnemyHits.Count.ToString(), player.RoundsNo.ToString(), PathForXml);
         this.Visibility = Visibility.Hidden;
         hs.Show();
     }
 }
예제 #2
0
        private void CreateHSWindowAndLoadIt(PlayerEntity player, string player2, bool win)
        {
            string wintext;

            if (win)
            {
                wintext = "Player won";
            }
            else
            {
                wintext = "AI won";
            }

            HighscoresWindow hs = new HighscoresWindow(wintext, player.PlayerName, player2, player.DestroyedShips.Count.ToString(), player.RemainingShips.Count.ToString(), player.PlayerHits.Count.ToString(), player.EnemyHits.Count.ToString(), player.RoundsNo.ToString());

            this.Visibility = Visibility.Hidden;
            hs.Show();
        }