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 c = new IntVec3(i, 1, j);
             MapGenUtility.DestroyAllAtLocation(c, map);
             //rect.GetIterator().MoveNext();
             //c = rect.GetIterator().Current;
         }
     }
 }
 public static void MakeDoors(ResolveParams rp, Map map)
 {
     foreach (IntVec3 intVec in MapGenUtility.DoorPosList)
     {
         MapGenUtility.DestroyAllAtLocation(intVec, map);
         Thing thing = ThingMaker.MakeThing(ThingDefOf.Door, rp.wallStuff);
         if (map.ParentFaction != null)
         {
             thing.SetFaction(map.ParentFaction, null);
         }
         else
         {
             Faction faction = Find.FactionManager.RandomEnemyFaction(true, false, true, TechLevel.Spacer);
             thing.SetFaction(faction, null);
         }
         GenSpawn.Spawn(thing, intVec, map);
     }
     MapGenUtility.DoorPosList.Clear();
 }