Example #1
0
        static void Main(string[] args)
        {
            var maiya = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov = new Meerkat("Yakov");
            var bogdan = new Meerkat("Bogdan");

            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");

            var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            var scratchyBaby = new Meerkat("Baby of Scratching Brother");
            var familyMeThinksHasFleas = new Mob { Name = "Sergei Scratchy Extended Family", Members = { brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby } };

            var sergeiFamily = new Mob {Name = "family of Sergei", Members = {sergei, mostBeautiousSisterofSergei, familyMeThinksHasFleas}}; //add familyMeThinksHasFleas into the extended sergeiFamily Mob

            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");
            var bogdanFamily = new Mob {Name = "family of Bogdan", Members = {bogdan, mothermabobOfBogdan, fathermabobOfBogdan}};

            var meerkovaVillagers = new Mob {Name = "Villagers", Members = {maiya, vassily, yakov, sergeiFamily, bogdanFamily}};

            meerkovaVillagers.InviteMyMostStupendousParty();

            Console.ReadLine();
        }
Example #2
0
        private static Mob CreateSergeiFamily()
        {
            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");
            var familyMeThinksHasFleas = CreateFamilyMeThinksHasFleas();

            var sergeiFamily = new Mob
            {
                Name = "family of Sergei",
                Members = {sergei, mostBeautiousSisterofSergei, familyMeThinksHasFleas}
            };

            return sergeiFamily;
        }
Example #3
0
        private static Mob CreateFamilyMeThinksHasFleas()
        {
            var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            var scratchyBaby = new Meerkat("Baby of Scratching Brother");

            var familyMeThinksHasFleas = new Mob
            {
                Name = "Sergei Scratchy Extended Family",
                Members = {brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby}
            };

            return familyMeThinksHasFleas;
        }
Example #4
0
        private static Mob CreateBogdanFamily()
        {
            var bogdan = new Meerkat("Bogdan");
            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");

            var bogdanFamily = new Mob
            {
                Name = "family of Bogdan",
                Members = {bogdan, mothermabobOfBogdan, fathermabobOfBogdan}
            };

            return bogdanFamily;
        }
Example #5
0
        private static Mob CreateFamilyMeThinksHasFleas()
        {
            var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            var scratchyBaby            = new Meerkat("Baby of Scratching Brother");

            var familyMeThinksHasFleas = new Mob
            {
                Name    = "Sergei Scratchy Extended Family",
                Members = { brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby }
            };

            return(familyMeThinksHasFleas);
        }
Example #6
0
        private static Mob CreateSergeiFamily()
        {
            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");
            var familyMeThinksHasFleas      = CreateFamilyMeThinksHasFleas();

            var sergeiFamily = new Mob
            {
                Name    = "family of Sergei",
                Members = { sergei, mostBeautiousSisterofSergei, familyMeThinksHasFleas }
            };

            return(sergeiFamily);
        }
Example #7
0
        private static Mob CreateBogdanFamily()
        {
            var bogdan = new Meerkat("Bogdan");
            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");

            var bogdanFamily = new Mob
            {
                Name    = "family of Bogdan",
                Members = { bogdan, mothermabobOfBogdan, fathermabobOfBogdan }
            };

            return(bogdanFamily);
        }
Example #8
0
        private static Mob AllVillagers()
        {
            var maiya = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov = new Meerkat("Yakov");

            var sergeiFamily = CreateSergeiFamily();
            var bogdanFamily = CreateBogdanFamily();

            var allVillagers = new Mob
            {
                Name = "All villagers",
                Members = {maiya, vassily, yakov, sergeiFamily, bogdanFamily}
            };

            return allVillagers;
        }
Example #9
0
        private static Mob AllVillagers()
        {
            var maiya   = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov   = new Meerkat("Yakov");

            var sergeiFamily = CreateSergeiFamily();
            var bogdanFamily = CreateBogdanFamily();

            var allVillagers = new Mob
            {
                Name    = "All villagers",
                Members = { maiya, vassily, yakov, sergeiFamily, bogdanFamily }
            };

            return(allVillagers);
        }
Example #10
0
        static void Main(string[] args)
        {
            var maiya   = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov   = new Meerkat("Yakov");
            var bogdan  = new Meerkat("Bogdan");

            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");

            //var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            //var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            //var scratchyBaby = new Meerkat("Baby of Scratching Brother");
            //var familyMeThinksHasFleas = new Mob{Name = "Sergei Scratchy Extended Family", Members = {brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby}};

            var sergeiFamily = new Mob {
                Name = "family of Sergei", Members = { sergei, mostBeautiousSisterofSergei }
            };                                                                                                       //add familyMeThinksHasFleas into the extended sergeiFamily Mob

            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");
            var bogdanFamily        = new Mob {
                Name = "family of Bogdan", Members = { bogdan, mothermabobOfBogdan, fathermabobOfBogdan }
            };

            // simplify this to avoid using two Lists?
            var meerkovaVillagers = new List <Meerkat> {
                maiya, vassily, yakov
            };
            var meerkovaVillageFamilies = new List <Mob> {
                sergeiFamily, bogdanFamily
            };

            // simplify this to avoid using any foreach loops
            foreach (var meerkat in meerkovaVillagers)
            {
                meerkat.InviteMyMostStupendousParty();
            }

            foreach (var meerkatFamily in meerkovaVillageFamilies)
            {
                meerkatFamily.InviteEveryoneInFamilyToMyMostStupendousParty();
            }

            Console.ReadLine();
        }
Example #11
0
        static void Main(string[] args)
        {
            var maiya = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov = new Meerkat("Yakov");
            var bogdan = new Meerkat("Bogdan");

            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");

            //var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            //var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            //var scratchyBaby = new Meerkat("Baby of Scratching Brother");
            //var familyMeThinksHasFleas = new Mob{Name = "Sergei Scratchy Extended Family", Members = {brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby}};

            var sergeiFamily = new Mob {Name = "family of Sergei", Members = {sergei, mostBeautiousSisterofSergei}}; //add familyMeThinksHasFleas into the extended sergeiFamily Mob

            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");
            var bogdanFamily = new Mob {Name = "family of Bogdan", Members = {bogdan, mothermabobOfBogdan, fathermabobOfBogdan}};

            // simplify this to avoid using two Lists?
            var meerkovaVillagers = new List<Meerkat> {maiya, vassily, yakov};
            var meerkovaVillageFamilies = new List<Mob> {sergeiFamily, bogdanFamily};

            // simplify this to avoid using any foreach loops
            foreach (var meerkat in meerkovaVillagers)
            {
                meerkat.InviteMyMostStupendousParty();
            }

            foreach (var meerkatFamily in meerkovaVillageFamilies)
            {
               meerkatFamily.InviteEveryoneInFamilyToMyMostStupendousParty();
            }

            Console.ReadLine();
        }
Example #12
0
        static void Main(string[] args)
        {
            var maiya   = new Meerkat("Maiya");
            var vassily = new Meerkat("Vassily");
            var yakov   = new Meerkat("Yakov");
            var bogdan  = new Meerkat("Bogdan");

            var sergei = new Meerkat("Sergei");
            var mostBeautiousSisterofSergei = new Meerkat("Beautious Sister Of Sergei");

            var brotherOfSergeiAlwaysWithTheScratching = new Meerkat("Scratching Brother of Sergei");
            var wifeOfScratchingBrother = new Meerkat("Wife of Scratching Brother");
            var scratchyBaby            = new Meerkat("Baby of Scratching Brother");
            var familyMeThinksHasFleas  = new Mob {
                Name = "Sergei Scratchy Extended Family", Members = { brotherOfSergeiAlwaysWithTheScratching, wifeOfScratchingBrother, scratchyBaby }
            };

            var sergeiFamily = new Mob {
                Name = "family of Sergei", Members = { sergei, mostBeautiousSisterofSergei, familyMeThinksHasFleas }
            };                                                                                                                               //add familyMeThinksHasFleas into the extended sergeiFamily Mob

            var mothermabobOfBogdan = new Meerkat("Mothermabob of Bogdan");
            var fathermabobOfBogdan = new Meerkat("Fathermabob of Bogdan");
            var bogdanFamily        = new Mob {
                Name = "family of Bogdan", Members = { bogdan, mothermabobOfBogdan, fathermabobOfBogdan }
            };


            var meerkovaVillagers = new Mob {
                Name = "Villagers", Members = { maiya, vassily, yakov, sergeiFamily, bogdanFamily }
            };

            meerkovaVillagers.InviteMyMostStupendousParty();

            Console.ReadLine();
        }