Exemplo n.º 1
0
        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();
                }
            }
        }
Exemplo n.º 2
0
        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);
            }
        }