示例#1
0
        private void NextLumberjack_Click(object sender, EventArgs e)
        {
            Lumberjack currentLumberjack = breakfastLine.Dequeue();

            currentLumberjack.EatFlapjacks();
            RedrawList();
        }
示例#2
0
        private void AddFlapjacks_Click(object sender, EventArgs e)
        {
            if (breakfastLine.Count == 0)
            {
                return;
            }
            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);

            RedrawList();
        }
示例#3
0
        private void RedrawList()
        {
            int numberInLine = 1;

            line.Items.Clear();
            foreach (Lumberjack lumberjack in breakfastLine)
            {
                line.Items.Add(numberInLine + ". " + lumberjack.Name + "\n");
                ++numberInLine;
            }


            if (breakfastLine.Count > 0)
            {
                Lumberjack currentLumberjack = breakfastLine.Peek();
                lumberJackSummary.Text = currentLumberjack.Name + " has " + currentLumberjack.FlapjackCount + " flapjacks";
            }

            Refresh();
        }