//<param name="mode">The initialization mode.</param> internal override void Initialize(InitializationModes mode) { //Split gear ratios & fade in/ out ranges into an array InternalFunctions.ParseStringToIntArray(gearratios, ref geararray, "gearratios"); InternalFunctions.ParseStringToIntArray(gearfadeinrange, ref gearfadeinarray, "gearfadeinrange"); InternalFunctions.ParseStringToIntArray(gearfadeoutrange, ref gearfadeoutarray, "gearfadeoutrange"); //Test if we have any gears if (geararray.Length == 1 && geararray[0] == 0) { nogears = true; totalgears = 0; } //If we have gears ensure that we're set in gear 0 //Also set value for total number of gears for easy access else { CurrentGear = 0; totalgears = geararray.Length + 1; } //Set previous revs to zero previousrevs = 0; //Parse heating rates into an array InternalFunctions.ParseStringToIntArray(heatingrate, ref heatingarray, "heatingrate"); //Set temperature to zero this.temperature = 0; //Parse fuel consumption into an array InternalFunctions.ParseStringToIntArray(fuelconsumption, ref fuelarray, "fuelconsumption"); fuel = (int)fuelstartamount; }
//<param name="mode">The initialization mode.</param> internal override void Initialize(InitializationModes mode) { stm_reverser = 0; stm_power = 0; cutoff = 30; cutoffstate = 0; stm_boilerpressure = (int)boilermaxpressure; if (boilerstartwaterlevel == -1) { stm_boilerwater = (int)boilermaxwaterlevel; } else { stm_boilerwater = (int)boilerstartwaterlevel; } fuel = (int)fuelstartamount; this.cutofftimer = 0.0; this.maintimer = 0.0; InternalFunctions.ParseStringToIntArray(heatingrate, ref heatingarray, "heatingrate"); //Calculate the water to steam rate and store it here, don't call every frame calculatedsteamrate = (int)boilerwatertosteamrate / 60; //Set the starting fire mass if (firestartmass == -1) { firemass = (int)maximumfiremass; } else { firemass = (int)firestartmass; } firetemp = (int)firestartemp; LastPower = 0; if (Blowoff.BlowoffTime != 0) { Blowoff.BlowoffRate = (Blowoff.TriggerPressure - boilermaxpressure) / Blowoff.BlowoffTime; } }