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