public static void DestroyAllInArea(Map map, CellRect rect) { for (int i = rect.minX; i <= rect.maxX; i++) { for (int j = rect.minZ; j <= rect.maxZ; j++) { IntVec3 current = new IntVec3(i, 1, j); MapGenUtility.DestroyAllAtLocation(current, map); rect.GetIterator().MoveNext(); current = rect.GetIterator().Current; } } }
public static void MakeDoors(ResolveParams rp, Map map) { foreach (IntVec3 current in MapGenUtility.DoorPosList) { MapGenUtility.DestroyAllAtLocation(current, map); Thing thing = ThingMaker.MakeThing(ThingDefOf.Door, rp.wallStuff); if (map.ParentFaction != null) { thing.SetFaction(map.ParentFaction, null); } else { thing.SetFaction(Find.FactionManager.FirstFactionOfDef(FactionDefOf.SpacerHostile), null); } GenSpawn.Spawn(thing, current, map); } MapGenUtility.DoorPosList.Clear(); }