/// <summary>
 /// Remove a population from the RPM.
 /// </summary>
 public void RemovePopulation(Population population)
 {
     if (!Populations.Contains(population))
     {
         return;
     }
     Populations.Remove(population);
     TypesOfTerrain.Remove(population);
     openID.Enqueue(PopulationToID[population]);
     PopulationByID.Remove(PopulationToID[population]); // free ID
     PopulationToID.Remove(population);                 // free ID
     CleanupAccessMapForRecycledID();
 }
Пример #2
0
 public Builder setPopulation(PopulationType populationType, int count)
 {
     if (count == 0)
     {
         Populations.Remove(populationType);
         return(this);
     }
     if (Populations.ContainsKey(populationType))
     {
         Populations[populationType] = count;
     }
     else
     {
         Populations.Add(populationType, count);
     }
     return(this);
 }