//--------------------------------------------------------------------- /// <summary> /// Adds a prescription to be applied to the management area. /// </summary> public void ApplyPrescription(Prescription prescription, Percentage percentageToHarvest, int startTime, int endTime) { // tjs - 2008.12.17 - reversing if and else if so that it checks for // SingleRepeatHarvest. This is done because SingleRepeatHarvest // is a descendent of RepeatHarvest, so the RepeatHarvest condition // is true if prescription is SingleRepeatHarvest if(prescription is SingleRepeatHarvest) { AppliedRepeatHarvest appy = new AppliedRepeatHarvest((SingleRepeatHarvest) prescription, percentageToHarvest, startTime, endTime); prescriptions.Add(appy); } else if (prescription is RepeatHarvest) { AppliedRepeatHarvest appy = new AppliedRepeatHarvest((RepeatHarvest)prescription, percentageToHarvest, startTime, endTime); prescriptions.Add(appy); } else prescriptions.Add(new AppliedPrescription(prescription, percentageToHarvest, startTime, endTime)); }
//--------------------------------------------------------------------- public AppliedPrescription(Prescription prescription, Percentage percentageToHarvest, int beginTime, int endTime) { //set prescription this.prescription = prescription; //set stand ranking method this.standSpreadSiteSelector = prescription.SiteSelectionMethod as StandSpreading; //set harvest percentage this.percentageToHarvest = percentageToHarvest; //set begin time and end time this.beginTime = beginTime; this.endTime = endTime; }