Exemple #1
0
 public void Add(Level level)
 {
     if (level == null)
         throw new ArgumentNullException("level");
     if (_levels.ContainsValue(level))
         throw new Exception("This level is already added.");
     level.SetLevelNumber(LastLevelNumber + 1);
     _levels.Add(level.LevelNumber, level);
 }
Exemple #2
0
 public void Replace(Level oldLevel, Level newLevel)
 {
     newLevel.SetLevelNumber(oldLevel.LevelNumber);
     _levels[oldLevel.LevelNumber] = newLevel;
 }