示例#1
0
 private void buttonStartGame_Click(object sender, EventArgs e)
 {
     if (gameState == 0)                         //	0=not playing / 1=playing / -1-play stopped
     //	not playing - check game
     {
         int nerr = gameTable.CheckTable(true);
         if (nerr > 0)
         {
             string msgid   = chlang.GetLocalizedString("MB_msg_errtable");
             string msgtype = chlang.GetLocalizedString("MB_caption_err");
             MessageBox.Show(msgid, msgtype, MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         //	not playing - start game
         buttonStartGame.Text                = "Játék leállítása";
         buttonClearGame.Text                = "Lépés törlése";
         buttonFillGame.Text                 = "Lejátszás törlése";
         buttonSaveGame.Text                 = "Megállítás";
         comboGameType.Enabled               =
             numericLevel.Enabled            =
                 comboGameName.Enabled       =
                     textGameComment.Enabled = false;
         buttonList = new List <int[]>();
         gameTable.ClearSelects();
         gameState = 1;
     }
     else
     {
         //	playing - stop game
         buttonStartGame.Text                = "--> Játék indítása";
         buttonClearGame.Text                = "Tábla törlése";
         buttonFillGame.Text                 = "Tábla kitöltése";
         buttonSaveGame.Text                 = "Játék mentése";
         comboGameType.Enabled               =
             numericLevel.Enabled            =
                 comboGameName.Enabled       =
                     textGameComment.Enabled = true;
         //	remove gamed cells
         int count = buttonList.Count;
         for (int ii = 0; ii < count; ii++)
         {
             gameTable.cell(buttonList[ii][0], buttonList[ii][1]).fixNum = 0;
         }
         pictureTable_Resize(null, null);
         gameState = 0;
     }
 }