Beispiel #1
0
 public void ExposeData()
 {
     Scribe_Collections.Look <Pawn>(ref this.pawnsForcefullyKeptAsWorldPawns, true, "pawnsForcefullyKeptAsWorldPawns", LookMode.Reference);
     Scribe_Collections.Look <Pawn>(ref this.pawnsAlive, "pawnsAlive", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsMothballed, "pawnsMothballed", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsDead, true, "pawnsDead", LookMode.Deep);
     Scribe_Deep.Look <WorldPawnGC>(ref this.gc, "gc", new object[0]);
     if (this.pawnsMothballed == null)
     {
         this.pawnsMothballed = new HashSet <Pawn>();
     }
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.WorldPawnPostLoadInit(this);
     }
 }
Beispiel #2
0
 public void ExposeData()
 {
     Scribe_Collections.Look <Pawn>(ref this.pawnsForcefullyKeptAsWorldPawns, true, "pawnsForcefullyKeptAsWorldPawns", LookMode.Reference);
     Scribe_Collections.Look <Pawn>(ref this.pawnsAlive, "pawnsAlive", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsMothballed, "pawnsMothballed", LookMode.Deep);
     Scribe_Collections.Look <Pawn>(ref this.pawnsDead, true, "pawnsDead", LookMode.Deep);
     Scribe_Deep.Look <WorldPawnGC>(ref this.gc, "gc", new object[0]);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         BackCompatibility.WorldPawnPostLoadInit(this, ref this.pawnsMothballed);
         if (this.pawnsForcefullyKeptAsWorldPawns.RemoveWhere((Pawn x) => x == null) != 0)
         {
             Log.Error("Some pawnsForcefullyKeptAsWorldPawns were null after loading.", false);
         }
         if (this.pawnsAlive.RemoveWhere((Pawn x) => x == null) != 0)
         {
             Log.Error("Some pawnsAlive were null after loading.", false);
         }
         if (this.pawnsMothballed.RemoveWhere((Pawn x) => x == null) != 0)
         {
             Log.Error("Some pawnsMothballed were null after loading.", false);
         }
         if (this.pawnsDead.RemoveWhere((Pawn x) => x == null) != 0)
         {
             Log.Error("Some pawnsDead were null after loading.", false);
         }
         if (this.pawnsAlive.RemoveWhere((Pawn x) => x.def == null || x.kindDef == null) != 0)
         {
             Log.Error("Some pawnsAlive had null def after loading.", false);
         }
         if (this.pawnsMothballed.RemoveWhere((Pawn x) => x.def == null || x.kindDef == null) != 0)
         {
             Log.Error("Some pawnsMothballed had null def after loading.", false);
         }
         if (this.pawnsDead.RemoveWhere((Pawn x) => x.def == null || x.kindDef == null) != 0)
         {
             Log.Error("Some pawnsDead had null def after loading.", false);
         }
     }
 }