Exemplo n.º 1
0
 public static void Postfix(Zone_Stockpile __instance)
 {
     KSLog.Message("[KanbanStockpile] Zone_Stockpile_PostDeregister_Patch.Postfix()");
     if (State.Exists(__instance.ToString()))
     {
         KSLog.Message("[KanbanStockpile] Removing " + __instance.ToString());
         State.Del(__instance.ToString());
     }
 }
        public override void ExposeData()
        {
            base.ExposeData();
            Scribe_Values.Look(ref TargetCount, "Count");
            Scribe_Values.Look(ref MaxUpperThreshold, "MaxUpperThreshold");
            Scribe_Values.Look(ref Op, "Operator");
            Scribe_Deep.Look(ref ThresholdFilter, "ThresholdFilter");
            Scribe_Values.Look(ref countAllOnMap, "CountAllOnMap");

            // stockpile needs special treatment - is not referenceable.
            if (Scribe.mode == LoadSaveMode.Saving)
            {
                _stockpile_scribe = stockpile?.ToString() ?? "null";
            }
            Scribe_Values.Look(ref _stockpile_scribe, "Stockpile", "null");
            if (Scribe.mode == LoadSaveMode.PostLoadInit)
            {
                stockpile =
                    manager.map.zoneManager.AllZones.FirstOrDefault(z => z is Zone_Stockpile &&
                                                                    z.label == _stockpile_scribe)
                    as Zone_Stockpile;
            }
        }