Example #1
0
 private void ExposeComponents()
 {
     Scribe_Deep.Look(ref weatherManager, "weatherManager", this);
     Scribe_Deep.Look(ref reservationManager, "reservationManager", this);
     Scribe_Deep.Look(ref physicalInteractionReservationManager, "physicalInteractionReservationManager");
     Scribe_Deep.Look(ref designationManager, "designationManager", this);
     Scribe_Deep.Look(ref pawnDestinationReservationManager, "pawnDestinationReservationManager");
     Scribe_Deep.Look(ref lordManager, "lordManager", this);
     Scribe_Deep.Look(ref passingShipManager, "visitorManager", this);
     Scribe_Deep.Look(ref gameConditionManager, "gameConditionManager", this);
     Scribe_Deep.Look(ref fogGrid, "fogGrid", this);
     Scribe_Deep.Look(ref roofGrid, "roofGrid", this);
     Scribe_Deep.Look(ref terrainGrid, "terrainGrid", this);
     Scribe_Deep.Look(ref zoneManager, "zoneManager", this);
     Scribe_Deep.Look(ref temperatureCache, "temperatureCache", this);
     Scribe_Deep.Look(ref snowGrid, "snowGrid", this);
     Scribe_Deep.Look(ref areaManager, "areaManager", this);
     Scribe_Deep.Look(ref lordsStarter, "lordsStarter", this);
     Scribe_Deep.Look(ref attackTargetReservationManager, "attackTargetReservationManager", this);
     Scribe_Deep.Look(ref deepResourceGrid, "deepResourceGrid", this);
     Scribe_Deep.Look(ref weatherDecider, "weatherDecider", this);
     Scribe_Deep.Look(ref damageWatcher, "damageWatcher");
     Scribe_Deep.Look(ref rememberedCameraPos, "rememberedCameraPos", this);
     Scribe_Deep.Look(ref mineStrikeManager, "mineStrikeManager");
     Scribe_Deep.Look(ref retainedCaravanData, "retainedCaravanData", this);
     Scribe_Deep.Look(ref storyState, "storyState", this);
     Scribe_Deep.Look(ref wildPlantSpawner, "wildPlantSpawner", this);
     Scribe_Deep.Look(ref temporaryThingDrawer, "temporaryThingDrawer");
     Scribe_Collections.Look(ref components, "components", LookMode.Deep, this);
     FillComponents();
     BackCompatibility.PostExposeData(this);
 }
Example #2
0
 public virtual void ExposeData()
 {
     if (Scribe.mode == LoadSaveMode.Saving && combatLogEntry != null)
     {
         LogEntry target = combatLogEntry.Target;
         if (target == null || !Current.Game.battleLog.IsEntryActive(target))
         {
             combatLogEntry = null;
         }
     }
     Scribe_Values.Look(ref loadID, "loadID", 0);
     Scribe_Defs.Look(ref def, "def");
     Scribe_Values.Look(ref ageTicks, "ageTicks", 0);
     Scribe_Defs.Look(ref source, "source");
     Scribe_Defs.Look(ref sourceBodyPartGroup, "sourceBodyPartGroup");
     Scribe_Defs.Look(ref sourceHediffDef, "sourceHediffDef");
     Scribe_BodyParts.Look(ref part, "part");
     Scribe_Values.Look(ref severityInt, "severity", 0f);
     Scribe_Values.Look(ref recordedTale, "recordedTale", defaultValue: false);
     Scribe_Values.Look(ref causesNoPain, "causesNoPain", defaultValue: false);
     Scribe_Values.Look(ref visible, "visible", defaultValue: false);
     Scribe_References.Look(ref combatLogEntry, "combatLogEntry");
     Scribe_Values.Look(ref combatLogText, "combatLogText");
     BackCompatibility.PostExposeData(this);
 }
Example #3
0
 private void ExposeSmallComponents()
 {
     Scribe_Deep.Look(ref info, "info");
     Scribe_Deep.Look(ref rules, "rules");
     Scribe_Deep.Look(ref scenarioInt, "scenario");
     Scribe_Deep.Look(ref tickManager, "tickManager");
     Scribe_Deep.Look(ref playSettings, "playSettings");
     Scribe_Deep.Look(ref storyWatcher, "storyWatcher");
     Scribe_Deep.Look(ref gameEnder, "gameEnder");
     Scribe_Deep.Look(ref letterStack, "letterStack");
     Scribe_Deep.Look(ref researchManager, "researchManager");
     Scribe_Deep.Look(ref storyteller, "storyteller");
     Scribe_Deep.Look(ref history, "history");
     Scribe_Deep.Look(ref taleManager, "taleManager");
     Scribe_Deep.Look(ref playLog, "playLog");
     Scribe_Deep.Look(ref battleLog, "battleLog");
     Scribe_Deep.Look(ref outfitDatabase, "outfitDatabase");
     Scribe_Deep.Look(ref drugPolicyDatabase, "drugPolicyDatabase");
     Scribe_Deep.Look(ref foodRestrictionDatabase, "foodRestrictionDatabase");
     Scribe_Deep.Look(ref tutor, "tutor");
     Scribe_Deep.Look(ref dateNotifier, "dateNotifier");
     Scribe_Deep.Look(ref uniqueIDsManager, "uniqueIDsManager");
     Scribe_Deep.Look(ref questManager, "questManager");
     Scribe_Collections.Look(ref components, "components", LookMode.Deep, this);
     if (Scribe.mode == LoadSaveMode.LoadingVars)
     {
         FillComponents();
         if (rules == null)
         {
             Log.Warning("Save game was missing rules. Replacing with a blank GameRules.");
             rules = new GameRules();
         }
     }
     BackCompatibility.PostExposeData(this);
 }
		public override void ExposeData()
		{
			base.ExposeData();
			Scribe_Defs.Look(ref ruleDef, "ruleDef");
			Scribe_Values.Look(ref alwaysShowInCompact, "alwaysShowInCompact", defaultValue: false);
			Scribe_References.Look(ref initiator, "initiator", saveDestroyedThings: true);
			Scribe_References.Look(ref recipientPawn, "recipientPawn", saveDestroyedThings: true);
			Scribe_Defs.Look(ref recipientThing, "recipientThing");
			Scribe_Defs.Look(ref implementType, "implementType");
			Scribe_Defs.Look(ref ownerEquipmentDef, "ownerDef");
			Scribe_Values.Look(ref toolLabel, "toolLabel");
			BackCompatibility.PostExposeData(this);
		}
Example #5
0
 public virtual void ExposeData()
 {
     Scribe_Values.Look(ref ID, "ID", -1);
     Scribe_Values.Look(ref label, "label");
     Scribe_Values.Look(ref baseLabel, "baseLabel");
     Scribe_Values.Look(ref color, "color");
     Scribe_Values.Look(ref hidden, "hidden", defaultValue: false);
     Scribe_Collections.Look(ref cells, "cells", LookMode.Undefined);
     BackCompatibility.PostExposeData(this);
     if (Scribe.mode == LoadSaveMode.PostLoadInit)
     {
         CheckAddHaulDestination();
     }
 }
Example #6
0
        public virtual void ExposeData()
        {
            Scribe_Defs.Look(ref def, "def");
            if (def.HasThingIDNumber)
            {
                string value = ThingID;
                Scribe_Values.Look(ref value, "id");
                ThingID = value;
            }
            Scribe_Values.Look <sbyte>(ref mapIndexOrState, "map", -1);
            if (Scribe.mode == LoadSaveMode.LoadingVars && mapIndexOrState >= 0)
            {
                mapIndexOrState = -1;
            }
            Scribe_Values.Look(ref positionInt, "pos", IntVec3.Invalid);
            Scribe_Values.Look(ref rotationInt, "rot", Rot4.North);
            if (def.useHitPoints)
            {
                Scribe_Values.Look(ref hitPointsInt, "health", -1);
            }
            bool flag = def.tradeability != 0 && def.category == ThingCategory.Item;

            if (def.stackLimit > 1 || flag)
            {
                Scribe_Values.Look(ref stackCount, "stackCount", 0, forceSave: true);
            }
            Scribe_Defs.Look(ref stuffInt, "stuff");
            string facID = ((factionInt != null) ? factionInt.GetUniqueLoadID() : "null");

            Scribe_Values.Look(ref facID, "faction", "null");
            if (Scribe.mode == LoadSaveMode.LoadingVars || Scribe.mode == LoadSaveMode.ResolvingCrossRefs || Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                if (facID == "null")
                {
                    factionInt = null;
                }
                else if (Find.World != null && Find.FactionManager != null)
                {
                    factionInt = Find.FactionManager.AllFactions.FirstOrDefault((Faction fa) => fa.GetUniqueLoadID() == facID);
                }
            }
            Scribe_Collections.Look(ref questTags, "questTags", LookMode.Value);
            BackCompatibility.PostExposeData(this);
        }