public void RemoveTreeInstances(System.Predicate <GTreeInstance> condition) { int removedCount = TreeInstances.RemoveAll(condition); if (removedCount > 0) { TreeAllChanged(); } }
public void Refresh() { if (Trees != null) { List <GTreePrototype> prototypes = Trees.Prototypes; for (int i = 0; i < prototypes.Count; ++i) { prototypes[i].Refresh(); } TreeInstances.RemoveAll(t => t.PrototypeIndex < 0 || t.PrototypeIndex >= Trees.Prototypes.Count); } if (Grasses != null) { for (int i = 0; i < GrassPatches.Length; ++i) { GrassPatches[i].Instances.RemoveAll(g => g.PrototypeIndex < 0 || g.PrototypeIndex >= Grasses.Prototypes.Count); } } CalculateEstimatedGrassStorage(); }