//--------------------------------------------------------------------- public Prescription(string name, IStandRankingMethod rankingMethod, ISiteSelector siteSelector, ICohortSelector cohortSelector, Planting.SpeciesList speciesToPlant, int minTimeSinceDamage, bool preventEstablishment) { this.number = nextNumber; nextNumber++; this.name = name; this.rankingMethod = rankingMethod; this.siteSelector = siteSelector; this.cohortSelector = cohortSelector; this.speciesToPlant = speciesToPlant; this.minTimeSinceDamage = minTimeSinceDamage; this.preventEstablishment = preventEstablishment; this.landUseAfterHarvest = landUseMostRecentlyChecked; }
//--------------------------------------------------------------------- public static void CheckLandUseName(string name) { // scan the name for LU-->{LU-name} const string LUmarker = "LU-->"; int positionOfLUmarker = name.IndexOf(LUmarker); int positionOfLUname = positionOfLUmarker + LUmarker.Length; string LUname = name.Substring(positionOfLUname); landUseMostRecentlyChecked = LandUse.LookupName(LUname); if (landUseMostRecentlyChecked == null) throw new InputValueException(LUname, "Unknown land-use name \"{0}\"", LUname); }
//--------------------------------------------------------------------- public Prescription(string name, IStandRankingMethod rankingMethod, ISiteSelector siteSelector, ICohortSelector cohortSelector, Planting.SpeciesList speciesToPlant, int minTimeSinceDamage, bool preventEstablishment) { this.number = nextNumber; nextNumber++; this.name = name; this.rankingMethod = rankingMethod; this.siteSelector = siteSelector; this.cohortSelector = cohortSelector; this.speciesToPlant = speciesToPlant; this.minTimeSinceDamage = minTimeSinceDamage; this.preventEstablishment = preventEstablishment; // scan the name for LU-->{LU-name} const string LUmarker = "LU-->"; int positionOfLUmarker = name.IndexOf(LUmarker); int positionOfLUname = positionOfLUmarker + LUmarker.Length; string LUname = name.Substring(positionOfLUname); this.landUseAfterHarvest = LandUse.LookupName(LUname); }