public static void Convert_Old_Stockpiles_To_Lazy(ZoneManager __instance, Zone[] ___zoneGrid) { Zone[] zoneGrid = ___zoneGrid; ZoneManager manager = __instance; Map map = manager.map; CellIndices cellIndices = manager.map.cellIndices; List <Zone> zones = manager.AllZones; List <Zone_Stockpile> deregister = new List <Zone_Stockpile>(); List <Lazy_Stockpile> register = new List <Lazy_Stockpile>(); for (int i = 0; i < zones.Count; i++) { Zone z = zones[i]; if (z as Zone_Stockpile != null && z as Lazy_Stockpile == null) { Lazy_Stockpile tmp = new Lazy_Stockpile(z as Zone_Stockpile); manager.AllZones.Remove(z); manager.AllZones.Add(tmp); foreach (IntVec3 c in tmp) { zoneGrid[cellIndices.CellToIndex(c)] = tmp; } //deregister.Add(z as Zone_Stockpile); //register.Add(tmp); Log.Message($"The stockpile {z.label} has been converted to a lazy stockpile"); } } }
public static void MakeNewZone(ref Zone __result) { __result = new Lazy_Stockpile(__result as Zone_Stockpile); }