private static void Main()
        {
            IMapComponent city = BuidCity();

            DrawArea(city);

            IMapComponent road = city.FindChild("Main Street");

            DrawArea(road);

            IMapComponent house = city.FindChild("House 2");

            DrawArea(house);

            Console.ReadLine();
        }
Beispiel #2
0
        private static void Main()
        {
            IMapComponent city = BuildCity(FlyweightComponentFactory.Instance);

            DrawArea(city);

            IMapComponent road = city.FindChild("Main Street");

            DrawArea(road);

            IMapComponent house = city.FindChild("City Park");

            DrawArea(house);

            Console.WriteLine($"Total trees instances : {FlyweightComponentFactory.Instance.TotalTrees}");
            Console.WriteLine($"Total roads instances : {FlyweightComponentFactory.Instance.TotalRoads}");

            Console.Read();
        }