コード例 #1
0
ファイル: Program.cs プロジェクト: artyomShepovalov/bsu
        static void Main()
        {
            int brick = 10;

            FlyweightFactory factory = new FlyweightFactory();

            Flyweight fx = factory.GetFlyweight("X");
            fx.Operation(--brick);

            Flyweight fy = factory.GetFlyweight("Y");
            fy.Operation(--brick);

            Flyweight fz = factory.GetFlyweight("Z");
            fz.Operation(--brick);

            UnsharedBrickFlyweight fu = new UnsharedBrickFlyweight();

            fu.Operation(--brick);

            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: artyomShepovalov/123
        static void Main()
        {
            int brick = 10;

            FlyweightFactory factory = new FlyweightFactory();

            Flyweight fx = factory.GetFlyweight("X");

            fx.Operation(--brick);

            Flyweight fy = factory.GetFlyweight("Y");

            fy.Operation(--brick);

            Flyweight fz = factory.GetFlyweight("Z");

            fz.Operation(--brick);

            UnsharedBrickFlyweight fu = new UnsharedBrickFlyweight();

            fu.Operation(--brick);

            Console.ReadKey();
        }