예제 #1
0
        private void AddFlyweight(RockType rockType)
        {
            Rock rock = null;

            switch (rockType)
            {
                case RockType.Jagged:
                    rock = new JaggedRock();
                    break;
                case RockType.Smooth:
                    rock = new SmoothRock();
                    break;
            }

            this.flywieghts.Add(rockType, rock);
            this.TotalObjectsCreated++;
        }
예제 #2
0
        private void AddFlyweight(RockType rockType)
        {
            Rock rock = null;

            switch (rockType)
            {
            case RockType.Jagged:
                rock = new JaggedRock();
                break;

            case RockType.Smooth:
                rock = new SmoothRock();
                break;
            }

            this.flywieghts.Add(rockType, rock);
            this.TotalObjectsCreated++;
        }