public void PastePriorities(PawnSurface referencedSurface) { if (referencedSurface == null) { string noReference = "DD_WorkTab_Message_NoCopyPasteReference".CachedTranslation(); Utilities.UserFeedbackChain(WorkSound.TaskFailed, noReference); return; } this.ConformWorkToList(referencedSurface.children); string pastedPriorities = "DD_WorkTab_Message_PastedPriorities".CachedTranslation(new string[] { referencedSurface.pawn.NameStringShort }).AdjustedFor(this.pawn); Utilities.UserFeedbackChain(WorkSound.TaskCompleted, pastedPriorities); }
private Dictionary <Pawn, PawnSurface> PawnSurfaceLookup = new Dictionary <Pawn, PawnSurface>(); //Rebuilt on save load public PawnSurface GetPawnSurface(Pawn pawn) { if (!this.PawnSurfaceLookup.TryGetValue(pawn, out PawnSurface surface)) { PawnSurface listSurface = this.allPawnSurfaces.Find(s => s.pawn == pawn); if (listSurface != null) { surface = listSurface; this.PawnSurfaceLookup[pawn] = listSurface; } else { surface = new PawnSurface(pawn); this.PawnSurfaceLookup[pawn] = surface; this.allPawnSurfaces.Add(surface); } } return(surface); }