Example #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++;
        }
Example #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++;
        }