Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Building godzillaHouse = new Building("1 Godzilla Lane")
            {
                Name    = "Godzilla's House",
                Stories = 100,
                Width   = 10000,
                Depth   = 10000
            };

            Building jawsHouse = new Building("1 Amity Island")
            {
                Name    = "Jaws' House",
                Stories = -100,
                Width   = 20000,
                Depth   = 50000
            };

            City Monsterville = new City("Monsterville")
            {
                Mayor       = "Joe Bob Briggs",
                YearFounded = 1983
            };

            godzillaHouse.Purchase("Mechagodzilla");

            Monsterville.AddBuilding(godzillaHouse);

            Monsterville.AddBuilding(jawsHouse);

            Monsterville.PrintBuildings();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Building townCenter = new Building("1 Center Plaza")
            {
                Name    = "Charleston Town Center",
                Stories = 3,
                Width   = 1400,
                Depth   = 40,
            };

            Building scienceMuseum = new Building("99 Nasa Lane")
            {
                Name    = "Clay Center for the Sciences",
                Stories = 2,
                Width   = 200,
                Depth   = 20,
            };

            City Charleston = new City("Charleston")
            {
                Mayor       = "Amy Goodwin",
                YearFounded = 1819,
            };

            townCenter.Purchase("Ebenezer Scrooge");
            scienceMuseum.Purchase("Marie Curie");

            townCenter.PrintBuilding();
            scienceMuseum.PrintBuilding();

            Charleston.AddBuilding(townCenter);
            Charleston.AddBuilding(scienceMuseum);

            Charleston.PrintBuildings();
        }