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); } } } }
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); }
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); } } } }