Exemplo n.º 1
0
        private void AddFlapjackButton_Click(object sender, EventArgs e)
        {
            if (breakfastLine.Count == 0)
            {
                return;
            }
            Flapjack food;

            if (crispyRadio.Checked)
            {
                food = Flapjack.Crispy;
            }
            else if (soggyRadio.Checked)
            {
                food = Flapjack.Soggy;
            }
            else if (brownedRadio.Checked)
            {
                food = Flapjack.Browned;
            }
            else
            {
                food = Flapjack.Banana;
            }

            Lumberjack current = breakfastLine.Peek();

            current.TakeFlapjacks(food, (int)numberOfLumberjack.Value);
            RedrawList();
            label2.Text = current.Name + " has " + current.flapjackCount + " flapjacks";
        }
Exemplo n.º 2
0
        private void NextLumberjackButton_Click(object sender, EventArgs e)
        {
            if (breakfastLine.Count == 0)
            {
                return;
            }
            Lumberjack current = breakfastLine.Dequeue();

            current.EatFlapjacks();
            label2.Text = "";
            RedrawList();
        }