示例#1
0
 public void Cleanup(int myIndex, JobDriver jobDriver)
 {
     if (this.finishActions != null)
     {
         for (int i = 0; i < this.finishActions.Count; i++)
         {
             try
             {
                 this.finishActions[i]();
             }
             catch (Exception ex)
             {
                 Log.Error(string.Concat(new object[]
                 {
                     "Pawn ",
                     this.actor.ToStringSafe <Pawn>(),
                     " threw exception while executing toil's finish action (",
                     i,
                     "), jobDriver=",
                     jobDriver.ToStringSafe <JobDriver>(),
                     ", job=",
                     jobDriver.job.ToStringSafe <Job>(),
                     ", toilIndex=",
                     myIndex,
                     ": ",
                     ex
                 }), false);
             }
         }
     }
 }
示例#2
0
 public JobDriver GetCachedDriver(Pawn driverPawn)
 {
     if (cachedDriver == null)
     {
         cachedDriver = MakeDriver(driverPawn);
     }
     if (cachedDriver.pawn != driverPawn)
     {
         Log.Error("Tried to use the same driver for 2 pawns: " + cachedDriver.ToStringSafe() + ", first pawn= " + cachedDriver.pawn.ToStringSafe() + ", second pawn=" + driverPawn.ToStringSafe());
     }
     return(cachedDriver);
 }
示例#3
0
文件: Toil.cs 项目: potsh/RimWorld
 public void Cleanup(int myIndex, JobDriver jobDriver)
 {
     if (finishActions != null)
     {
         for (int i = 0; i < finishActions.Count; i++)
         {
             try
             {
                 finishActions[i]();
             }
             catch (Exception ex)
             {
                 Log.Error("Pawn " + actor.ToStringSafe() + " threw exception while executing toil's finish action (" + i + "), jobDriver=" + jobDriver.ToStringSafe() + ", job=" + jobDriver.job.ToStringSafe() + ", toilIndex=" + myIndex + ": " + ex);
             }
         }
     }
 }