Exemplo n.º 1
0
 public void SetupTraitEndTime()
 {
     if (this.HasSpecialCase(PersonalityTrait.SpecialCaseType.CarPartPromise) && !this.mDriver.IsFreeAgent())
     {
         this.mTraitEndTime = this.mDriver.Contract.GetTeam().championship.GetCurrentEventDetails().raceSessions[0].sessionDateTime;
     }
     else if (this.HasSpecialCase(PersonalityTrait.SpecialCaseType.ChampionshipPositionPromise) && !this.mDriver.IsFreeAgent())
     {
         this.mTraitEndTime = this.mDriver.Contract.GetTeam().championship.currentSeasonEndDate.AddDays(-1.0);
     }
     else if (this.data.possibleLength.Length == 1)
     {
         this.mTraitEndTime = Game.instance.time.now.AddDays((double)(7 * this.data.possibleLength[0]));
     }
     else if (this.data.possibleLength.Length > 1)
     {
         int randomInc = RandomUtility.GetRandomInc(this.data.possibleLength[0], this.data.possibleLength[1]);
         this.mTraitEndTime = Game.instance.time.now.AddDays((double)(7 * randomInc));
     }
     else
     {
         this.mTraitEndTime = Game.instance.time.now.AddDays(1.0);
     }
 }
Exemplo n.º 2
0
 public static int GetRandomInc(int inMin, int inMax)
 {
     return(RandomUtility.GetRandomInc(inMin, inMax, RandomUtility.globalRandomInstance));
 }