Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Kid kid = new Kid()
            {
                Gender          = Gender.Male,
                Height          = 145,
                LevelOfHappines = 100,
                Money           = 99,
                Name            = "John"
            };

            AttractionManager manager = new AttractionManager(0);

            Park(manager, kid);

            ShowKidAfterAttractionClosing(kid);

            //Kid kid = new Kid();
            //int height;
            //Gender gender;
            //WeekDay weekDay;
            //Attractions attraction;

            //Console.WriteLine("Enter kid height in cm: ");
            //while (!int.TryParse(Console.ReadLine(), out height))
            //{
            //    Console.WriteLine("Height is not a number");
            //}

            //kid.Height = height;

            //Console.WriteLine("Choose Week Day (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday): ");
            //while (!Enum.TryParse(Console.ReadLine(), out weekDay))
            //{
            //    Console.WriteLine("Enter Week Day in right format: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday");
            //}

            //Console.WriteLine("Choose kid gender (Male, Female): ");
            //while (!Enum.TryParse(Console.ReadLine(), out gender))
            //{
            //    Console.WriteLine("Uknown gender. Please choose one of: Male, Female");
            //}

            //kid.Gender = gender;

            //Console.WriteLine("Enter Kid Name: ");
            //kid.Name = Console.ReadLine();

            //Console.WriteLine("Which Attraction kid want to visit (Batman, Swan, Pony): ");
            //while (!Enum.TryParse(Console.ReadLine(), out attraction))
            //{
            //    Console.WriteLine("Uknown Attraction name. Please choose one of: Batman, Swan, Pony.");
            //}

            //KidAllowedToAttractions(weekDay, kid, attraction);

            Console.ReadKey();
        }
Ejemplo n.º 2
0
        static void Park(AttractionManager manager, Kid kid)
        {
            while (manager.CheckCash())
            {
                bool isAllowed;
                Console.WriteLine($"Is {kid.Name} allowed to ride (true, false)");
                while (!bool.TryParse(Console.ReadLine(), out isAllowed))
                {
                    Console.WriteLine("Uknown format, pleas enter: true or false");
                }

                manager.IsKidAllowedToRide(isAllowed, kid);
            }
        }
        static void Main()
        {
            // method for setting day of week from console input.
            var day = ConsoleInputValidation.GetValidadedDayOfWeek();

            // Initializing (generating) random parameters for 10 Kids.
            var groupOfRandomKids = new RandomKidGenerator();

            // Initializing (generating) random parameters for attractions (Pony, Swan, Batman)
            var groupOfRandomAttractions = new RandomAttractionGenerator();

            //Create new Attraction Manager with already generated(prepared) data for Kids and Attractions
            var generalAttractionManager = new AttractionManager(groupOfRandomKids, groupOfRandomAttractions, day);

            // open attraction
            generalAttractionManager.ToRide();

            Console.ReadLine();
        }