Beispiel #1
0
        private void addFlapjacks_Click(object sender, EventArgs e)
        {
            Flapjack food;

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

            Lumberjack currentLumberjack = breakfastLine.Peek();

            currentLumberjack.TakeFlapjacks(food, (int)howMany.Value);
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Lumberjack nextLumberjack = breakfastLine.Dequeue();

            nextLumberjack.EatFlapjacks();
            nextInLine.Text = "";
            RedrawList();
        }
Beispiel #3
0
        private void RedrawList()
        {
            int number = 1;

            Line.Items.Clear();
            foreach (Lumberjack lumberjack in breakfastLine)
            {
                Line.Items.Add(number + ". " + lumberjack.Name);
                number++;
            }
            if (breakfastLine.Count == 0)
            {
                groupBox1.Enabled = false;
                nextInLine.Text   = "";
            }
            else
            {
                groupBox1.Enabled = true;
                Lumberjack currentLumberjack = breakfastLine.Peek();
                nextInLine.Text = currentLumberjack.Name + "得到了" + currentLumberjack.FlapjackCount + "flapjacks";
            }
        }