private void DoPestDiseaseDamage(object sender, EventArgs e) { if (HostOrgan.GetType() == typeof(ICanopy)) { HostPlant.ReduceCanopy(Reduction.Value()); } else if (HostOrgan.GetType() == typeof(IRoot)) { HostPlant.ReduceRootLengthDensity(Reduction.Value()); } else { throw new Exception("FunctionalDimensionReduction is only possible for organs implementing ICanopy or IRoot interfaces"); } }
private void DoPestDiseaseDamage(object sender, EventArgs e) { HostPlant.ReduceCanopy(ParentStage.TotalPopulation * RateOfOrganObstructionPerIndividual.Value()); }