예제 #1
0
파일: Program.cs 프로젝트: perl-easj/OOProg
        private static void RunSpecificScenario()
        {
            ForrestGumpGenerator  fgGenerator = new ForrestGumpGenerator();
            ChocolateBoxGenerator cbGenerator = new ChocolateBoxGenerator();

            ForrestGump  gump = fgGenerator.GenerateForrestGump();
            ChocolateBox box  = cbGenerator.GenerateChocolateBox();

            gump.SayFavoriteProverb();
            while (box.ChocolateLeft)
            {
                gump.Eat(box.TakeAChocolate());
            }

            Console.WriteLine();
            Console.WriteLine();
        }
 public ForrestGumpScenarioFactoryAdapters()
 {
     _chocolateBoxGenerator = new ChocolateBoxGenerator();
     _forrestGumpGenerator  = new ForrestGumpGenerator();
 }