public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType) { if ((value == null)) { return(null); } SeasonName valueCasted = ((SeasonName)(value)); if ((valueCasted == SeasonName.Winter)) { return("winter"); } if ((valueCasted == SeasonName.Fall)) { return("fall"); } if ((valueCasted == SeasonName.Spring)) { return("spring"); } if ((valueCasted == SeasonName.Summer)) { return("summer"); } throw new ArgumentOutOfRangeException("value"); }
//--------------------------------------------------------------------- public WindDirectionParameters( SeasonName nameOfSeason, double[] windDirections ) { this.nameOfSeason = nameOfSeason; this.windDirections = windDirections; }
//--------------------------------------------------------------------- public SeasonParameters() { this.nameOfSeason = 0; //Spring this.leafStatus = 0; //LeafOn this.fireProbability = 0.0; this.WSVdist = 0; this.WSVp1 = 0; this.WSVp2 = 0; this.FFMCdist = 0; this.FFMCp1 = 0; this.FFMCp2 = 0; this.BUIdist = 0; this.BUIp1 = 0; this.BUIp2 = 0; this.percentCuring = 0; }
//--------------------------------------------------------------------- public SeasonParameters( SeasonName nameOfSeason, LeafOnOff leafStatus, double fireProbability, Distribution WSVdist, double WSVp1, double WSVp2, Distribution FFMCdist, double FFMCp1, double FFMCp2, Distribution BUIdist, double BUIp1, double BUIp2, int percentCuring ) { this.nameOfSeason = nameOfSeason; this.leafStatus = leafStatus; this.fireProbability = fireProbability; this.WSVdist = WSVdist; this.WSVp1 = WSVp1; this.WSVp2 = WSVp2; this.FFMCdist = FFMCdist; this.FFMCp1 = FFMCp1; this.FFMCp2 = FFMCp2; this.BUIdist = BUIdist; this.BUIp1 = BUIp1; this.BUIp2 = BUIp2; this.percentCuring = percentCuring; }
public void CheckDistanceWrapAround() { var distance = SeasonName.Distance(SeasonName.Fall, SeasonName.Winter); Assert.AreEqual(distance, 1); }
public void CheckDistanceSimple() { var distance = SeasonName.Distance(SeasonName.Winter, SeasonName.Spring); Assert.AreEqual(distance, 1); }
void OnPlayerEnteredAreaEvent(PlayerEnteredAreaEvent evt) { if(this.currentSeason != SeasonName.None) { var distance = SeasonName.Distance(this.currentSeason, evt.seasonName); EventManager.FireEvent(new ItemWaitedEvent(this.gameObject, distance)); } }