//--------------------------------------------------------------------- void AgeCohort.ISiteCohorts.RemoveMarkedCohorts(AgeCohort.ISpeciesCohortsDisturbance disturbance) { if (AgeOnlyDisturbanceEvent != null) { AgeOnlyDisturbanceEvent(this, new DisturbanceEventArgs(disturbance.CurrentSite, disturbance.Type)); } //JSF - FIXME }
//--------------------------------------------------------------------- void AgeCohort.ISiteCohorts.RemoveMarkedCohorts(AgeCohort.ISpeciesCohortsDisturbance disturbance) { if (AgeOnlyDisturbanceEvent != null) { AgeOnlyDisturbanceEvent(this, new DisturbanceEventArgs(disturbance.CurrentSite, disturbance.Type)); } // Go through list of species cohorts from back to front so that // a removal does not mess up the loop. int totalReduction = 0; for (int i = cohorts.Count - 1; i >= 0; i--) { totalReduction += cohorts[i].MarkCohorts(disturbance); if (cohorts[i].Count == 0) { cohorts.RemoveAt(i); } } }