Пример #1
0
 public static void RegenerateAvoidGridsFor(Faction faction, Map map)
 {
     if (faction.def.canUseAvoidGrid)
     {
         ByteGrid byteGrid = default(ByteGrid);
         if (faction.avoidGridsSmart.TryGetValue(map, out byteGrid))
         {
             byteGrid.Clear(0);
         }
         else
         {
             byteGrid = new ByteGrid(map);
             faction.avoidGridsSmart.Add(map, byteGrid);
         }
         ByteGrid byteGrid2 = default(ByteGrid);
         if (faction.avoidGridsBasic.TryGetValue(map, out byteGrid2))
         {
             byteGrid2.Clear(0);
         }
         else
         {
             byteGrid2 = new ByteGrid(map);
             faction.avoidGridsBasic.Add(map, byteGrid2);
         }
         AvoidGridMaker.GenerateAvoidGridInternal(byteGrid, faction, map, AvoidGridMode.Smart);
         AvoidGridMaker.GenerateAvoidGridInternal(byteGrid2, faction, map, AvoidGridMode.Basic);
     }
 }
Пример #2
0
 public static void RegenerateAvoidGridsFor(Faction faction, Map map)
 {
     if (faction.def.canUseAvoidGrid)
     {
         Profiler.BeginSample("RegenerateAvoidGridsFor " + faction);
         ByteGrid byteGrid;
         if (faction.avoidGridsSmart.TryGetValue(map, out byteGrid))
         {
             byteGrid.Clear(0);
         }
         else
         {
             byteGrid = new ByteGrid(map);
             faction.avoidGridsSmart.Add(map, byteGrid);
         }
         ByteGrid byteGrid2;
         if (faction.avoidGridsBasic.TryGetValue(map, out byteGrid2))
         {
             byteGrid2.Clear(0);
         }
         else
         {
             byteGrid2 = new ByteGrid(map);
             faction.avoidGridsBasic.Add(map, byteGrid2);
         }
         AvoidGridMaker.GenerateAvoidGridInternal(byteGrid, faction, map, AvoidGridMode.Smart);
         AvoidGridMaker.GenerateAvoidGridInternal(byteGrid2, faction, map, AvoidGridMode.Basic);
         Profiler.EndSample();
     }
 }
        public static void RegenerateAvoidGridsFor(Faction faction, Map map)
        {
            if (!faction.def.canUseAvoidGrid)
            {
                return;
            }
            ByteGrid byteGrid;

            if (faction.avoidGridsSmart.TryGetValue(map, out byteGrid))
            {
                byteGrid.Clear(0);
            }
            else
            {
                byteGrid = new ByteGrid(map);
                faction.avoidGridsSmart.Add(map, byteGrid);
            }
            AvoidGridMaker.GenerateAvoidGridInternal(byteGrid, faction, map, AvoidGridMode.Smart);
        }