コード例 #1
0
 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");
     }
 }
コード例 #2
0
 private void DoPestDiseaseDamage(object sender, EventArgs e)
 {
     HostPlant.ReduceCanopy(ParentStage.TotalPopulation * RateOfOrganObstructionPerIndividual.Value());
 }