Exemplo 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();
        }
Exemplo n.º 2
0
        private void level3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            level3.Checked = true;

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

            ControlInfo.getInstance().setLevel(Level.LEVEL_1);
            //startGame();
        }
Exemplo 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();
 }
Exemplo 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();
 }
Exemplo n.º 6
0
        public void init()
        {
            FieldSize size = ControlInfo.getInstance().GameSize;

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

            initArrays();
            initField();
        }
Exemplo 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();
            }
        }
Exemplo 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);
        }
Exemplo 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();
            }
        }
Exemplo n.º 10
0
 private void ru_Click(object sender, EventArgs e)
 {
     ControlInfo.getInstance().CurrentLang = LanguageId.RU;
     setLangMenuChecked();
 }