コード例 #1
0
 private void BtnStartGame_Click(object sender, RoutedEventArgs e)
 {
     if (fileWorker.CheckNameInSaves(tbxName2.Text))
     {
         NewGame game = new NewGame(fileWorker.GetOneSave("Saves\\" + tbxName2.Text + ".txt"));
         game.Gamer.SetTable(GameTable.CreateTable());
         game.ScoresForLvl = GameTable.Words.Count;
         WGame winWGame = new WGame(game);
         winWGame.Show();
         this.Close();
     }
     else
     {
         tbxName2.Text = "Игрока не существует";
     }
 }
コード例 #2
0
 private void BtnStartNewGame_Click(object sender, RoutedEventArgs e)
 {
     if (fileWorker.CheckNameInSaves(tbxName1.Text))
     {
         tbxName1.Text = "Имя уже используется";
     }
     else if (tbxName1.Text == "")
     {
         tbxName1.Text = "Введите имя";
     }
     else
     {
         NewGame game     = new NewGame(new GamerInfo(tbxName1.Text, 0, GameTable.CreateTable()));
         WGame   winWGame = new WGame(game);
         winWGame.Show();
         this.Close();
     }
 }
コード例 #3
0
ファイル: Menu.cs プロジェクト: Nanoster1/Fillwords
        public static void UseMenu()
        {
            Drawer.DrawTitle();
            Drawer.DrawMenu(ConsoleColor.Red, ConsoleColor.Black, ConsoleColor.Black, ConsoleColor.Black, ConsoleColor.Red, ConsoleColor.Green, ConsoleColor.Green, ConsoleColor.Green, menu1, menu2, menu3, menu4);
            int menuNum = SelectMenu();

            switch (menuNum)
            {
            case 1:
                VisualGame.StartGame(new NewGame(new GamerInfo(VisualGame.Greetings(), 0, GameTable.CreateTable())));
                break;

            case 2:
                MenuResume.ContinueGame();
                break;

            case 3:
                MenuRecords.DrawRecords();
                break;

            case 4:
                MenuSelectOpt.Head();
                break;
            }
        }