예제 #1
0
파일: Main.cs 프로젝트: petur03/Hangtur
        private void MakeAttempt_Click(object sender, EventArgs e)
        {
            InputForm    inputForm = new InputForm(Properties.Resources.attemptTitle);
            DialogResult diagRes   = inputForm.ShowDialog();

            if (diagRes == DialogResult.OK)
            {
                String attempt = inputForm.Input;

                bool res = gameLogic.Attempt(attempt);

                UpdateState(gameLogic);

                if (res)
                {
                    Won();
                }
            }
        }
예제 #2
0
파일: Main.cs 프로젝트: petur03/Hangtur
        private void Reset()
        {
            InputForm    inputForm = new InputForm(Properties.Resources.newGameTitle);
            DialogResult res       = inputForm.ShowDialog();

            if (res == DialogResult.OK)
            {
                try
                {
                    gameLogic = new GameLogic(inputForm.Input);
                } catch (ArgumentException e)
                {
                    MessageBox.Show(e.Message);
                    return;
                }

                Active     = true;
                guide.Text = Properties.Resources.guidePressLetter;

                UpdateState(gameLogic);
            }
        }