예제 #1
0
        static void Main(string[] args)
        {
            Case       mainCase   = new Case();
            Occamy     occamy     = new Occamy("Flying Fish", 15);
            Bowtruckle bowtruckle = new Bowtruckle("Green bean", 6);
            Demiguise  demiguise  = new Demiguise("Snorlax", 78);

            mainCase.AddAnimal(occamy);
            mainCase.AddAnimal(demiguise);
            mainCase.AddAnimal(bowtruckle);

            Console.WriteLine(mainCase.GetAnimalVoice(occamy.Name));
            Console.WriteLine(mainCase.GetAllVoices());
            Console.WriteLine(mainCase.GetTotalFoodWeight());
            Console.WriteLine(mainCase.GetAverageFoodWeight());

            mainCase.SetTimeToNight();
            Console.WriteLine(mainCase.GetAllVoices());

            mainCase.RandomEncounter();
            mainCase.RandomEncounter();
            mainCase.SetTimeToDay();

            Console.WriteLine(mainCase.GetAllVoices());
            Console.WriteLine(mainCase.GetTotalFoodWeight());

            HabitationsGroup habitationsGroup = new HabitationsGroup();

            habitationsGroup.AddContainer(HabitationHandler.CreateHandlers().PickHabitation(new Demiguise("Old Snorlax", 59)));
            mainCase.AddContainer(habitationsGroup);

            Console.WriteLine(mainCase.GetAllVoices());

            mainCase.RemoveContainer(habitationsGroup);
            mainCase.RemoveAnimal("Snorlax");

            Console.WriteLine(mainCase.GetAllVoices());
            Console.ReadKey();
        }
예제 #2
0
파일: Case.cs 프로젝트: SMTRPZ/Kovtko-IT71
 public Case(HabitationsGroup unit)
 {
     storageRoot  = unit;
     voiceHandler = new DayTimeHandler(storageRoot);
 }