Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Human[] people_array = { new Botan("Bob"),       new Student("Rick"), new Student("Joe"), new Girl("Pam"),
                                     new PrettyGirl("Jill"), new SmartGirl("Sandy") };
            for (int i = 0; i < 6; i++)
            {
                var first  = people_array[UniqueRandom.Instance.Next(people_array.Length)];
                var second = people_array[UniqueRandom.Instance.Next(people_array.Length)];
                var couple = CoupleAttribute.Couple(first, second);
                Console.WriteLine($" {first.GetType().Name} {first.Name} + {second.GetType().Name} {second.Name} " + couple.GetType().Name);
                try
                {
                    Console.WriteLine(couple.Name + "   " + couple.GetType().Name);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);
                }

                Program.KeyListener();
            }
        }