Exemplo n.º 1
0
        public static void save(List <Thing> thingsToSave, string fileLocation, Thing source)
        {
            Log.Message("Saving to: " + fileLocation);
            Scribe.InitWriting(fileLocation, "Stargate");

            //Log.Message("Starting Save");
            //Save Pawn

            //Scribe_Collections.LookList<Thing>(ref thingsToSave, "things", LookMode.Deep, (object)null);

            //Scribe.EnterNode("map");
            //Scribe.EnterNode("things");
            //source.ExposeData();
            Scribe_Collections.LookList <Thing>(ref thingsToSave, "things", LookMode.Deep, (object)null);
            //Scribe.ExitNode();

            //Scribe.ExitNode();

            /*
             * for (int i = 0; i < thingsToSave.Count; i++)
             * {
             *  Scribe_Deep.LookDeep<Thing>(ref thingsToSave[i], thingsToSave[i].ThingID);
             * }*/

            Scribe.FinalizeWriting();
            Scribe.mode = LoadSaveMode.Inactive;
            //Log.Message("End Save");
        }
Exemplo n.º 2
0
        public void ExposeData()
        {
            Scribe_Values.LookValue(ref Name, nameof(Name));
            Scribe_Values.LookValue(ref Label, nameof(Label));
            Scribe_Values.LookValue(ref Description, nameof(Description));
            Scribe_Values.LookValue(ref ProductLabel, nameof(ProductLabel));
            Scribe_Values.LookValue(ref ProductDescription, nameof(ProductDescription));

            Scribe_Values.LookValue(ref IsUnlocked, nameof(IsUnlocked));
            Scribe_Values.LookValue(ref IsUnlocking, nameof(IsUnlocking));
            Scribe_Values.LookValue(ref IsOption, nameof(IsOption));
            Scribe_Values.LookValue(ref WasOption, nameof(WasOption));

            Scribe_Values.LookValue(ref Nutrition, nameof(Nutrition));
            Scribe_Values.LookValue(ref Mass, nameof(Mass));
            Scribe_Values.LookValue(ref MarketValue, nameof(MarketValue));
            Scribe_Values.LookValue(ref WorkToMake, nameof(WorkToMake));
            Scribe_Values.LookValue(ref Yield, nameof(Yield));
            Scribe_Values.LookValue(ref DaysToRot, nameof(DaysToRot));
            Scribe_Values.LookValue(ref Progress, nameof(Progress));
            Scribe_Values.LookValue(ref MaxProgress, nameof(MaxProgress));
            Scribe_Values.LookValue(ref Tier, nameof(Tier));

            Scribe_Collections.LookList(ref Ingredients, nameof(Ingredients), LookMode.Deep);
            Scribe_Collections.LookList(ref Effects, nameof(Effects), LookMode.Deep);
        }
Exemplo n.º 3
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_References.LookReference <Pawn>(ref this.pawn, "pawn", false);
     Scribe_Defs.LookDef <PsykerPowerDef>(ref this.powerdef, "powerdef");
     Scribe_Collections.LookList <ThingComp>(ref this.comps, "comps", LookMode.Reference, new object[0]);
 }
Exemplo n.º 4
0
        public override void ExposeData()
        {
            base.ExposeData();

            // store research defs as these are the defining elements
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                _saveableQueue = _queue.Select(node => node.Research).ToList();
            }

            Scribe_Collections.LookList(ref _saveableQueue, "Queue", LookMode.Def);

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                // initialize the tree if not initialized
                if (!Tree.Initialized)
                {
                    Tree.Initialize();
                }

                // initialize the queue
                foreach (ResearchProjectDef research in _saveableQueue)
                {
                    // find a node that matches the research - or null if none found
                    ResearchNode node = research.Node();

                    // enqueue the node
                    if (node != null)
                    {
                        Enqueue(node, true);
                    }
                }
            }
        }
Exemplo n.º 5
0
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_Values.LookValue(ref Turn, nameof(Turn));
            Scribe_Collections.LookList(ref RecipeSpecs, nameof(RecipeSpecs), LookMode.Deep);
        }
Exemplo n.º 6
0
        public void ExposeData()
        {
            // settings
            Scribe_Values.LookValue(ref AllowTogglingLegend, "AllowToggingLegend", true);
            Scribe_Values.LookValue(ref DrawInlineLegend, "ShowLegend", true);
            Scribe_Values.LookValue(ref DrawTargetLine, "DrawTargetLine", true);
            Scribe_Values.LookValue(ref DrawOptions, "DrawOptions", true);
            Scribe_Values.LookValue(ref Suffix, "Suffix", "");
            Scribe_Values.LookValue(ref DrawIcons, "DrawIcons", true);
            Scribe_Values.LookValue(ref DrawCounts, "DrawCounts", true);
            Scribe_Values.LookValue(ref DrawInfoInBar, "DrawInfoInBar", false);
            Scribe_Values.LookValue(ref DrawMaxMarkers, "DrawMaxMarkers", true);
            Scribe_Values.LookValue(ref MaxPerChapter, "MaxPerChapter", false);

            // history chapters
            Scribe_Collections.LookList(ref _chapters, "Chapters", LookMode.Deep);

            // some post load tweaks
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                // set chapters shown to the newly loaded chapters (instead of the default created empty chapters).
                _chaptersShown.Clear();
                _chaptersShown.AddRange(_chapters);
            }
        }
Exemplo n.º 7
0
        public override void PostExposeData()
        {
            base.PostExposeData();
            //            Scribe_Collections.LookDictionary<PsykerPower, Verb_CastWarpPower>(ref this.psykerPowers, "psykerPowers", LookMode.Deep, LookMode.Reference);

            //          Scribe_Collections.LookList<PsykerPower>(ref this.allPowers, "allPowers", LookMode.Deep, new object[]
            //          {
            //              this.psyker,
            //              new object()
            //          });
            //          Scribe_Collections.LookList<PsykerPower>(ref this.temporaryApparelPowers, "temporaryApparelPowers", LookMode.Reference, new object[]
            //          {
            //              this.psyker,
            //              new object()
            //          });
            //       Scribe_Collections.LookList<PsykerPower>(ref this.temporaryWeaponPowers, "temporaryWeaponPowers", LookMode.Reference, new object[0]);
            Scribe_Collections.LookList(ref this.allpsykerPowers, "allpsykerPowers", LookMode.Deep, new object[0]);


            Scribe_Values.LookValue <string>(ref this.patronName, "patronName", "Emperor", false);
            Scribe_Values.LookValue <int>(ref this.TicksToCast, "TicksToCast", 0, false);
            Scribe_Values.LookValue <int>(ref this.TicksToCastMax, "TicksToCastMax", 1, false);
            Scribe_Values.LookValue <float>(ref this.TicksToCastPercentage, "TicksToCastPercentage", 1, false);
            Scribe_Values.LookValue <bool>(ref this.IsActive, "IsActive", false, false);
            Scribe_Values.LookValue <bool>(ref this.ShotFired, "ShotFired", true, false);
            //          Scribe_Deep.LookDeep<Verb_CastWarpPower>(ref this.curVerb, "curVerb", null);
            //          Scribe_TargetInfo.LookTargetInfo(ref this.CurTarget, "CurTarget", null);

            Scribe_Deep.LookDeep <PsykerPowerManager>(ref this.psykerPowerManager, "psykerPowerManager", new object[]
            {
                this
            });
        }
Exemplo n.º 8
0
        public override void ExposeData()
        {
            if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                hasData = false;
                SetDefaultValues();
            }

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                savedKLists    = MainTabWindow_Numbers.savedKLists;
                chosenPawnType = MainTabWindow_Numbers.chosenPawnType;
            }

            if (Scribe.mode == LoadSaveMode.LoadingVars || Scribe.mode == LoadSaveMode.Saving)
            {
                Scribe_Values.LookValue <MainTabWindow_Numbers.pawnType>(ref chosenPawnType, "chosenPawnType", MainTabWindow_Numbers.pawnType.Colonists);
                foreach (MainTabWindow_Numbers.pawnType type in Enum.GetValues(typeof(MainTabWindow_Numbers.pawnType)))
                {
                    tmpKList = savedKLists[type];
                    Scribe_Collections.LookList <KListObject>(ref tmpKList, "klist-" + type, LookMode.Deep);
                    savedKLists[type] = tmpKList;

                    /*foreach(KListObject obj in tmpKList)
                     * {
                     *  Log.Message("scribe loaded object "+ obj.oType.ToString() + ", " + obj.label + "," + (obj.displayObject == null? "NULL!" : obj.displayObject.ToString()));
                     * }*/
                }
                hasData = true;
            }
        }
Exemplo n.º 9
0
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Deep.LookDeep <ReadablesManager>(ref this.readablesManager, "readablesManager", new object[0]);
            //        Scribe_Deep.LookDeep<PatronInfo>(ref this.patronInfo, "patronInfo", new object());
            Scribe_Values.LookValue <bool>(ref this.NoPatron, "NoPatron", true, false);
            Scribe_Values.LookValue <bool>(ref this.IsImmune, "IsImmune", false, false);
            Scribe_Values.LookValue <string>(ref this.patronInfo.PatronName, "PatronName", "Emperor", false);


            //        Scribe_Collections.LookList<SoulTrait>(ref this.SoulTraits, "SoulTraits", LookMode.Deep, new object[0]);
            Scribe_Collections.LookList <Pawn>(ref this.OpposingDevotees, "OpposingDevotees", LookMode.Reference, new object[0]);

            Scribe_Values.LookValue <ChaosGods>(ref this.Patron, "Patron", ChaosGods.Undivided, false);

            Scribe_Values.LookValue <PsykerPowerLevel>(ref this.PsykerPowerLevel, "PsykerPowerLevel", PsykerPowerLevel.Rho, false);
            Scribe_Values.LookValue <CulturalToleranceCategory>(ref this.CulturalTolerance, "CulturalTolerance", CulturalToleranceCategory.Neutral, false);

            //        Scribe_Deep.LookDeep<AfflictionProperty>(ref this.PawnAfflictionProps, "PawnAfflictionProps", null);

            Scribe_Deep.LookDeep <SoulTrait>(ref this.DevotionTrait, "DevotionTrait", new object[0]);
            Scribe_Deep.LookDeep <SoulTrait>(ref this.PatronTrait, "PatronTrait", new object[0]);
            Scribe_Deep.LookDeep <SoulTrait>(ref this.CommonSoulTrait, "CommonSoulTrait", new object[0]);
            //   {
            //       CorruptionDefOfs.Devotion,
            //       this.DevotionTrait.SDegree
            //   });

            if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs)
            {
            }
        }
Exemplo n.º 10
0
 public override void ExposeData()
 {
     Scribe_Collections.LookDictionary(ref bribeCount, "bribeCount", LookMode.Value, LookMode.Value);
     Scribe_Values.LookValue(ref defaultInteractionMode, "defaultInteractionMode", PrisonerInteractionMode.NoInteraction);
     Scribe_Values.LookValue(ref lastEventKey, "lastEventKey", 0);
     Scribe_Collections.LookList(ref eventQueue, "eventQueue", LookMode.Deep);
 }
Exemplo n.º 11
0
 public void ExposeData()
 {
     Scribe_Collections.LookDictionary <ThingDef, int>(ref this.acquiredMats, "acquiredMats", LookMode.DefReference, LookMode.Value);
     Scribe_Collections.LookList(ref this.requiredMaterials, "requiredMaterials", LookMode.Deep);
     Scribe_Values.LookValue(ref this.hasMats, "hasMats");
     Scribe_Values.LookValue(ref this.instaBuild, "instaBuild");
 }
Exemplo n.º 12
0
 public override void ExposeData()
 {
     Scribe_References.LookReference <Faction>(ref this.IoM, "IoM");
     Scribe_References.LookReference <Faction>(ref this.PatronFaction, "PatronFaction");
     Scribe_References.LookReference <Faction>(ref this.ImperialGuard, "ImperialGuard");
     Scribe_References.LookReference <Faction>(ref this.AdeptusSororitas, "AdeptusSororitas");
     Scribe_References.LookReference <Faction>(ref this.Mechanicus, "Mechanicus");
     Scribe_References.LookReference <Faction>(ref this.EldarWarhost, "EldarWarhost");
     Scribe_References.LookReference <Faction>(ref this.DarkEldarKabal, "DarkEldarKabal");
     Scribe_References.LookReference <Faction>(ref this.ChaosCult, "ChaosCult");
     Scribe_References.LookReference <Faction>(ref this.Tau, "Tau");
     Scribe_Collections.LookList <Faction>(ref this.ImperialFactions, "ImperialFactions", LookMode.Reference, new object[0]);
     Scribe_Collections.LookList <Faction>(ref this.XenoFactions, "XenoFactions", LookMode.Reference, new object[0]);
     Scribe_Collections.LookList <StarMapObject>(ref this.SubSectorObjects, "SubSectorObjects", LookMode.Deep, new object[0]);
     Scribe_Values.LookValue <bool>(ref this.IoMCanHelp, "FactionCanHelp", false, true);
     Scribe_Values.LookValue <bool>(ref this.activeRaid, "activeRaid", false, true);
     Scribe_Values.LookValue <bool>(ref this.PlayerIsEnemyOfMankind, "PlayerIsEnemyOfMankind", false, true);
     Scribe_Values.LookValue <bool>(ref this.AcknowledgedByImperium, "AcknowledgedByImperium", false, true);
     Scribe_Values.LookValue <int>(ref this.DaysAfterHelp, "DaysAfterHelp", 4, false);
     Scribe_Values.LookValue <int>(ref this.DaysToTitheCollection, "DaysToTitheCollection", 30, false);
     Scribe_Values.LookValue <float>(ref this.ColonyCorruptionAvg, "ColonyCorruptionAvg", 0.8f, false);
     Scribe_Values.LookValue <string>(ref this.SubsectorName, "SubsectorName", "Aurelia", false);
     Scribe_Collections.LookList <Tithes.TitheEntryGlobal>(ref this.currentTithes, "currentTithes", LookMode.Deep, new object[0]);
     base.ExposeData();
 }
Exemplo n.º 13
0
        public override void ExposeData()
        {
            base.ExposeData();

            // settings, references first!
            Scribe_References.LookReference(ref TameArea, "TameArea");
            Scribe_Collections.LookList(ref RestrictArea, "AreaRestrictions", LookMode.Reference);
            Scribe_Deep.LookDeep(ref Trigger, "trigger", manager);
            Scribe_Deep.LookDeep(ref Training, "Training");
            Scribe_Values.LookValue(ref ButcherExcess, "ButcherExcess", true);
            Scribe_Values.LookValue(ref ButcherTrained, "ButcherTrained", false);
            Scribe_Values.LookValue(ref RestrictToArea, "RestrictToArea", false);
            Scribe_Values.LookValue(ref TryTameMore, "TryTameMore", false);

            // our current designations
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                // populate with all designations.
                Designations.AddRange(
                    manager.map.designationManager.DesignationsOfDef(DesignationDefOf.Slaughter)
                    .Where(des => ((Pawn)des.target.Thing).kindDef == Trigger.pawnKind));
                Designations.AddRange(
                    manager.map.designationManager.DesignationsOfDef(DesignationDefOf.Tame)
                    .Where(des => ((Pawn)des.target.Thing).kindDef == Trigger.pawnKind));
            }

            // this is an array of strings as the first (and only) parameter - make sure it doesn't get cast to array of objects for multiple parameters.
            Scribe_Deep.LookDeep(ref _history, "History");
        }
Exemplo n.º 14
0
        public override void ExposeData()
        {
            base.ExposeData();

            Scribe_References.LookReference <Building_OutpostCommandConsole>(ref commandConsole, "commandConsole");
            Scribe_Collections.LookList <IntVec3>(ref this.watchedCells, "watchedCells", LookMode.Value);
        }
Exemplo n.º 15
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <int>(ref this.nextFleetID, "nextFleetID");
     Scribe_Collections.LookDictionary <int, string>(ref this.PlayerFleetManager, "PlayerFleetManager", LookMode.Value, LookMode.Value);
     Scribe_Collections.LookList <ShipBase>(ref this.AllWorldShips, "AllWorldShips", LookMode.Reference, new object[0]);
 }
Exemplo n.º 16
0
        public override void ExposeData()
        {
            // scribe available loadouts
            Scribe_Collections.LookList <Loadout>(ref Instance._loadouts, "loadouts", LookMode.Deep);

            //scribe loadout assignments (for some reason using the dictionary directly doesn't work -- Fluffy)
            // create list of scribe helper objects
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                Instance._assignedLoadoutsScribeHelper = Instance._assignedLoadouts.Select(pair => new LoadoutAssignment()
                {
                    pawn = pair.Key, loadout = pair.Value
                }).ToList();
            }

            //scribe that list
            Scribe_Collections.LookList(ref Instance._assignedLoadoutsScribeHelper, "assignments", LookMode.Deep);

            // convert back into useable dictionary
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                Instance._assignedLoadouts = Instance
                                             ._assignedLoadoutsScribeHelper
                                             .Where(a => a.Valid) // removes assignments that for some reason have a null value.
                                             .ToDictionary(k => k.pawn, v => v.loadout);
            }
        }
Exemplo n.º 17
0
        public override void ExposeData()
        {
            if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                hasData = false;
                SetDefaultValues();
            }

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                savedKLists    = MainTabWindow_Numbers.savedKLists;
                chosenPawnType = MainTabWindow_Numbers.chosenPawnType;
            }

            if (Scribe.mode == LoadSaveMode.LoadingVars || Scribe.mode == LoadSaveMode.Saving)
            {
                Scribe_Values.LookValue <MainTabWindow_Numbers.pawnType>(ref chosenPawnType, "chosenPawnType", MainTabWindow_Numbers.pawnType.Colonists);
                foreach (MainTabWindow_Numbers.pawnType type in Enum.GetValues(typeof(MainTabWindow_Numbers.pawnType)))
                {
                    tmpKList = savedKLists[type];
                    Scribe_Collections.LookList <KListObject>(ref tmpKList, "klist-" + type, LookMode.Deep);
                    savedKLists[type] = tmpKList;
                }
                hasData = true;
            }
        }
Exemplo n.º 18
0
        public void ExposeData()
        {
            Scribe_References.LookReference(ref this.pawn, "thing");
            Scribe_Defs.LookDef(ref this.manaDef, "manaDef");
            Scribe_Values.LookValue(ref this.manaValue, "manaValue");
            Scribe_Values.LookValue(ref this.whaitingForThinkNode, "whaitingForThinkNode");
            Scribe_Defs.LookDef(ref this.currentAbility, "abilityDef");
            Scribe_Deep.LookDeep(ref this.effectState, "effectState");
            Scribe_Collections.LookList(ref this.currentTargets, "targets", LookMode.Deep);
            Scribe_Collections.LookList(ref this.executionLogs, "executionLogs", LookMode.Deep);
            Scribe_Collections.LookList(ref this.currentMotes, "currentMotes", LookMode.Deep);

            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                if (this.currentTargets != null)
                {
                    foreach (Saveable_Target value in this.currentTargets.ToArray())
                    {
                        if (value.target == null)
                        {
                            this.currentTargets.Remove(value);
                        }
                    }
                }
            }
        }
Exemplo n.º 19
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <bool>(ref this.forcedEnd, "forcedEnd");
     Scribe_Values.LookValue <int>(ref this.originalDuration, "originalDuration");
     Scribe_Collections.LookList <Pawn>(ref this.visitors, "visitors", LookMode.MapReference, new object[0]);
     Scribe_Collections.LookDictionary <int, PawnVisitInfo>(ref this.visitInfoMap, "visitInfoMap", LookMode.Value, LookMode.Deep);
 }
Exemplo n.º 20
0
 public void ExposeData()
 {
     Scribe_Values.LookValue <string>(ref this.id, "id", null, true);
     Scribe_Values.LookValue <string>(ref this.name, "name", string.Empty, true);
     Scribe_Values.LookValue <bool>(ref this.showInColonistBar, "showInColonistBar", true, true);
     Scribe_Values.LookValue <bool>(ref this.showInOverviewTabs, "showInOverviewTabs", true, true);
     Scribe_Collections.LookList <Pawn>(ref this.pawns, "pawns", LookMode.MapReference, null);
 }
Exemplo n.º 21
0
        public override void ExposeData()
        {
            base.ExposeData();

            this.outpostThingList = OG_Util.RefreshThingList(this.outpostThingList);
            Scribe_Collections.LookList <Thing>(ref this.outpostThingList, "outpostThingList", LookMode.MapReference);
            Scribe_Values.LookValue <IntVec3>(ref this.dropZoneCenter, "dropZoneCenter");
        }
        public void ExposeData()
        {
            Scribe_Values.LookValue <string>(ref this.pawnKindDef, "pawnKindDef", null, false);
            Scribe_Values.LookValue <string>(ref this.thingDef, "thingDef", ThingDefOf.Human.defName, false);
            Scribe_Values.LookValue <Gender>(ref this.gender, "gender", Gender.Male, false);
            Scribe_Values.LookValue <string>(ref this.childhood, "childhood", null, false);
            Scribe_Values.LookValue <string>(ref this.adulthood, "adulthood", null, false);
            Scribe_Collections.LookList <string>(ref this.traitNames, "traitNames", LookMode.Value, null);
            Scribe_Collections.LookList <int>(ref this.traitDegrees, "traitDegrees", LookMode.Value, null);
            Scribe_Values.LookValue <Color>(ref this.skinColor, "skinColor", Color.white, false);
            Scribe_Values.LookValue <float>(ref this.melanin, "melanin", -1.0f, false);
            Scribe_Values.LookValue <string>(ref this.bodyType, "bodyType", null, false);
            Scribe_Values.LookValue <string>(ref this.hairDef, "hairDef", null, false);
            Scribe_Values.LookValue <Color>(ref this.hairColor, "hairColor", Color.white, false);
            Scribe_Values.LookValue <string>(ref this.headGraphicPath, "headGraphicPath", null, false);
            Scribe_Values.LookValue <string>(ref this.firstName, "firstName", null, false);
            Scribe_Values.LookValue <string>(ref this.nickName, "nickName", null, false);
            Scribe_Values.LookValue <string>(ref this.lastName, "lastName", null, false);
            if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                Scribe_Values.LookValue <int>(ref this.age, "age", 0, false);
            }
            Scribe_Values.LookValue <int>(ref this.biologicalAge, "biologicalAge", 0, false);
            Scribe_Values.LookValue <int>(ref this.chronologicalAge, "chronologicalAge", 0, false);
            Scribe_Collections.LookList <string>(ref this.skillNames, "skillNames", LookMode.Value, null);
            Scribe_Collections.LookList <int>(ref this.skillValues, "skillValues", LookMode.Value, null);
            Scribe_Collections.LookList <Passion>(ref this.passions, "passions", LookMode.Value, null);
            Scribe_Collections.LookList <string>(ref this.apparel, "apparel", LookMode.Value, null);
            Scribe_Collections.LookList <int>(ref this.apparelLayers, "apparelLayers", LookMode.Value, null);
            Scribe_Collections.LookList <string>(ref this.apparelStuff, "apparelStuff", LookMode.Value, null);
            Scribe_Collections.LookList <Color>(ref this.apparelColors, "apparelColors", LookMode.Value, null);
            Scribe_Values.LookValue <bool>(ref this.randomInjuries, "randomInjuries", false, true);

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                Scribe_Collections.LookList <SaveRecordImplantV3>(ref this.implants, "implants", LookMode.Deep, null);
            }
            else
            {
                if (Scribe.curParent["implants"] != null)
                {
                    Scribe_Collections.LookList <SaveRecordImplantV3>(ref this.implants, "implants", LookMode.Deep, null);
                }
            }

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                Scribe_Collections.LookList <SaveRecordInjuryV3>(ref this.injuries, "injuries", LookMode.Deep, null);
            }
            else
            {
                if (Scribe.curParent["implants"] != null)
                {
                    Scribe_Collections.LookList <SaveRecordInjuryV3>(ref this.injuries, "injuries", LookMode.Deep, null);
                }
            }
        }
        public override void                PostExposeData()
        {
            base.PostExposeData();

            //Log.Message( thisBuilding.ThingID + "::PostExposeData() {\n\tScribeMode: " + Scribe.mode );

            Scribe_Collections.LookList <RefrigeratorContents>(ref contents, "contents", LookMode.Deep);

            //Log.Message( "} // " + thisBuilding.ThingID + "::PostExposeData()" );
        }
Exemplo n.º 24
0
        public void ExposeData()
        {
            // basic info about this loadout
            Scribe_Values.LookValue(ref label, "label");
            Scribe_Values.LookValue(ref uniqueID, "uniqueID");
            Scribe_Values.LookValue(ref canBeDeleted, "canBeDeleted", true);
            Scribe_Values.LookValue(ref defaultLoadout, "defaultLoadout", false);

            // slots
            Scribe_Collections.LookList(ref _slots, "slots", LookMode.Deep);
        }
Exemplo n.º 25
0
 public void ExposeData()
 {
     Scribe_Values.LookValue <ShrineStatus>(ref this.previousShrineStatus, "previousShrineStatus", ShrineStatus.one);
     Scribe_Values.LookValue <double>(ref this.intervalDelta, "intervalDelta", 0.0);
     Scribe_Values.LookValue <double>(ref this.hourDeltaAcc, "hourDeltaAcc", 0.0);
     Scribe_Values.LookValue <int>(ref this.hourOfDay, "hourOfDay", GenDate.HourOfDay);
     Scribe_Values.LookValue <int>(ref this.dayOfMonth, "dayOfMonth", GenDate.DayOfMonth);
     Scribe_Values.LookValue <Season>(ref this.season, "season", GenDate.CurrentSeason);
     Scribe_Collections.LookList <double>(ref this.gaugeDeltaHour, "gaugeDeltaHour", LookMode.Value, new object[0]);
     Scribe_Collections.LookList <double>(ref this.gaugeDeltaDay, "gaugeDeltaDay", LookMode.Value, new object[0]);
     Scribe_Values.LookValue <int>(ref this.currentMagic, "currentMagic", 0);
 }
Exemplo n.º 26
0
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe_Values.LookValue(ref rescued, "rescued");
     Scribe_Values.LookValue(ref chat, "chat");
     Scribe_Values.LookValue(ref recruit, "recruit");
     Scribe_Collections.LookList(ref boughtItems, "boughtItems", LookMode.Value);
     if (boughtItems == null)
     {
         boughtItems = new List <int>();
     }
 }
Exemplo n.º 27
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Values.LookValue <int>(ref this.patrolTicksToNextRotation, "patrolTicksToNextRotation");
     Scribe_Values.LookValue <float>(ref this.turretRotation, "turretRotation");
     Scribe_Values.LookValue <bool>(ref this.patrolClockwiseRotation, "patrolRotationClockwise");
     Scribe_Values.LookValue <int>(ref this.patrolTicksUntilRotationEnd, "ticksUntilPatrolRotationEnd");
     Scribe_Values.LookValue <int>(ref this.missilesTicksUntilNextLaunch, "ticksSinceLastMissileLaunch");
     Scribe_Values.LookValue <int>(ref this.missilesLoadedNumber, "loadedMissiles");
     Scribe_Values.LookValue <int>(ref this.missilesReloadingProgress, "ticksUntilMissileReloading");
     Scribe_Collections.LookList <DropPodIncoming>(ref this.acquiredTargets, "acquiredTargets", LookMode.Deep);
 }
Exemplo n.º 28
0
 public override void ExposeData()
 {
     base.ExposeData();
     Scribe_Collections.LookList <ShipBase>(ref this.ships, "ships", LookMode.Deep, new object[0]);
     Scribe_Values.LookValue <int>(ref this.destinationTile, "destinationTile", 0, false);
     Scribe_Values.LookValue <IntVec3>(ref this.destinationCell, "destinationCell", default(IntVec3), false);
     Scribe_Values.LookValue <PawnsArriveMode>(ref this.arriveMode, "arriveMode", PawnsArriveMode.Undecided, false);
     Scribe_Values.LookValue <bool>(ref this.arrived, "arrived", false, false);
     Scribe_Values.LookValue <int>(ref this.initialTile, "initialTile", 0, false);
     Scribe_Values.LookValue <float>(ref this.traveledPct, "traveledPct", 0f, false);
     Scribe_Values.LookValue <TravelingShipArrivalAction>(ref this.arrivalAction, "arrivalAction", TravelingShipArrivalAction.StayOnWorldMap, false);
 }
Exemplo n.º 29
0
        public void ExposeData()
        {
            Scribe_Defs.LookDef <SoulTraitDef>(ref this.SDef, "SDef");
            Scribe_Collections.LookList <ThoughtDef>(ref this.NullifiedThoughtsInt, "NullifiedThoughtsInt", LookMode.Def, new object[0]);
            Scribe_Values.LookValue <int>(ref this.sdegree, "sdegree", 0, true);
            if (Scribe.mode == LoadSaveMode.ResolvingCrossRefs && this.SDef == null)
            {
                this.SDef = DefDatabase <SoulTraitDef> .GetRandom();

                this.sdegree = this.SDef.SDegreeDatas.RandomElementByWeight((SoulTraitDegreeData dd) => dd.Commonality).degree;
            }
        }
Exemplo n.º 30
0
        public static void LookDictionary <K, V>(ref Dictionary <K, V> dict, string dictLabel, LookMode keyLookMode = LookMode.Undefined,
                                                 LookMode valueLookMode = LookMode.Undefined)
        {
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                return;
            }

            Scribe.EnterNode(dictLabel);

            var list1 = new List <K>();
            var list2 = new List <V>();

            if (Scribe.mode == LoadSaveMode.Saving)
            {
                if (dict == null)
                {
                    throw new ArgumentNullException("dict");
                }

                foreach (var v in dict)
                {
                    list1.Add(v.Key);
                    list2.Add(v.Value);
                }
            }

            Scribe_Collections.LookList(ref list1, "keys", keyLookMode);
            Scribe_Collections.LookList(ref list2, "values", valueLookMode);

            if (Scribe.mode == LoadSaveMode.LoadingVars)
            {
                if (dict == null)
                {
                    dict = new Dictionary <K, V>();
                }
                else
                {
                    dict.Clear();
                }

                if (list1 != null && list2 != null)
                {
                    for (var index = 0; index < list1.Count; ++index)
                    {
                        dict.Add(list1[index], list2[index]);
                    }
                }
            }

            Scribe.ExitNode();
        }