Esempio n. 1
0
        private void setLangMenuChecked()
        {
            switch (ControlInfo.getInstance().CurrentLang)
            {
            case LanguageId.ENG:
                english.Checked = true;
                uk.Checked      = false;
                ru.Checked      = false;
                break;

            case LanguageId.RU:
                english.Checked = false;
                uk.Checked      = false;
                ru.Checked      = true;
                break;

            case LanguageId.UA:
                english.Checked = false;
                uk.Checked      = true;
                ru.Checked      = false;
                break;

            default:
                break;
            }

            updateTextTrans();
        }
Esempio n. 2
0
        private void level3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            level3.Checked = true;

            ControlInfo.getInstance().setLevel(Level.LEVEL_3);
            //startGame();
        }
Esempio n. 3
0
        // LEWEL
        private void choiceOfDifficultyLevelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            level1.Checked = true;

            ControlInfo.getInstance().setLevel(Level.LEVEL_1);
            //startGame();
        }
Esempio n. 4
0
 public void showInfoForm()
 {
     dateTimePickerTime.Text = ControlInfo.getInstance().CurrentInfo.Time;
     textBoxName.Text        = ControlInfo.getInstance().CurrentInfo.Name;
     textBoxLevel.Text       = ControlInfo.getInstance().CurrentInfo.Level;
     Show();
     updateTextTrans();
 }
Esempio n. 5
0
 // list champions
 public void updateForm()
 {
     dataGridViewChempions.Rows.Clear();
     foreach (var i in ControlInfo.getInstance().Infos)
     {
         dataGridViewChempions.Rows.Add(i.Value.Name, i.Value.Level, i.Value.Time);
     }
     Show();
 }
Esempio n. 6
0
        public void init()
        {
            FieldSize size = ControlInfo.getInstance().GameSize;

            SIZE_X = size.Width;
            SIZE_Y = size.Height;

            initArrays();
            initField();
        }
Esempio n. 7
0
        private void Ok_Click(object sender, EventArgs e)
        {
            ControlInfo.getInstance().addInfoName(textBoxUserName.Text, game.getSize().ToString());

            // controllInfo.addInfoName(textBoxUserName.Text,
            if (true)
            {
                Close();
            }
        }
Esempio n. 8
0
        public string getTranslation(TextId textId)
        {
            string result = "MISSING_TRANLATION!!!";

            if (translations.ContainsKey(textId))
            {
                Dictionary <LanguageId, string> langlPack = translations[textId];
                if (langlPack.ContainsKey(ControlInfo.getInstance().CurrentLang))
                {
                    result = langlPack[ControlInfo.getInstance().CurrentLang];
                }
            }
            return(result);
        }
Esempio n. 9
0
        private void onBtnClick(object sender, MouseEventArgs e)
        {
            Button targetBtn = sender as Button;
            int    targetJ   = (targetBtn.Location.X - MARGINE) / CELL_SIZE;
            int    targetI   = (targetBtn.Location.Y - MARGINE) / CELL_SIZE;

            Console.WriteLine("Btn click: sender: J = " + targetJ + "; I = " + targetI);

            game.openButton(targetI, targetJ);

            bool isMine = game.mine(targetI, targetJ);
            bool isWin  = game.checkWin();

            if (isMine)
            {
                game.openAllMines();
            }
            else if (isMine)
            {
                game.openAll();
            }


            //DelateBut
            delateButUpdate();

            if (isMine)
            {
                Console.WriteLine("YOU LOSS!!!");
                MessageBox.Show("YOU LOSS!!!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);

                cleanForm();
            }
            else if (isWin)
            {
                //TIME GAME
                endTime  = DateTime.Now;
                timeGame = (endTime.Hour - startTime.Hour).ToString() + ":" + (endTime.Minute - startTime.Minute).ToString() + ":" + (endTime.Second - startTime.Second).ToString();

                ControlInfo.getInstance().addTimeGame(timeGame);

                Console.WriteLine("YOU WIN!!! " + timeGame);
                infoWin.showInfoForm();
            }
        }
Esempio n. 10
0
 private void ru_Click(object sender, EventArgs e)
 {
     ControlInfo.getInstance().CurrentLang = LanguageId.RU;
     setLangMenuChecked();
 }