コード例 #1
0
 public static void CheckBugs(Map map)
 {
     Autotests_RegionListers.CalculateExpectedListers(map);
     Autotests_RegionListers.CheckThingRegisteredTwice(map);
     Autotests_RegionListers.CheckThingNotRegisteredButShould();
     Autotests_RegionListers.CheckThingRegisteredButShouldnt(map);
 }
コード例 #2
0
 public void TryRebuildDirtyRegionsAndRooms()
 {
     if (working || !Enabled)
     {
         return;
     }
     working = true;
     if (!initialized)
     {
         RebuildAllRegionsAndRooms();
     }
     if (!map.regionDirtyer.AnyDirty)
     {
         working = false;
         return;
     }
     try
     {
         RegenerateNewRegionsFromDirtyCells();
         CreateOrUpdateRooms();
     }
     catch (Exception arg)
     {
         Log.Error("Exception while rebuilding dirty regions: " + arg);
     }
     newRegions.Clear();
     map.regionDirtyer.SetAllClean();
     initialized = true;
     working     = false;
     if (DebugSettings.detectRegionListersBugs)
     {
         Autotests_RegionListers.CheckBugs(map);
     }
 }
コード例 #3
0
 public void TryRebuildDirtyRegionsAndRooms()
 {
     if (!this.working && this.Enabled)
     {
         this.working = true;
         if (!this.initialized)
         {
             this.RebuildAllRegionsAndRooms();
         }
         if (!this.map.regionDirtyer.AnyDirty)
         {
             this.working = false;
         }
         else
         {
             try
             {
                 this.RegenerateNewRegionsFromDirtyCells();
                 this.CreateOrUpdateRooms();
             }
             catch (Exception arg)
             {
                 Log.Error("Exception while rebuilding dirty regions: " + arg, false);
             }
             this.newRegions.Clear();
             this.map.regionDirtyer.SetAllClean();
             this.initialized = true;
             this.working     = false;
             if (DebugSettings.detectRegionListersBugs)
             {
                 Autotests_RegionListers.CheckBugs(this.map);
             }
         }
     }
 }
コード例 #4
0
 private static void CheckThingRegisteredTwice(Map map)
 {
     foreach (KeyValuePair <Region, List <Thing> > expectedLister in Autotests_RegionListers.expectedListers)
     {
         Autotests_RegionListers.CheckDuplicates(expectedLister.Value, expectedLister.Key, true);
     }
     foreach (Region allRegion in map.regionGrid.AllRegions)
     {
         Autotests_RegionListers.CheckDuplicates(allRegion.ListerThings.AllThings, allRegion, false);
     }
 }
コード例 #5
0
 private static void CheckThingRegisteredTwice(Map map)
 {
     foreach (KeyValuePair <Region, List <Thing> > current in Autotests_RegionListers.expectedListers)
     {
         Autotests_RegionListers.CheckDuplicates(current.Value, current.Key, true);
     }
     foreach (Region current2 in map.regionGrid.AllRegions)
     {
         Autotests_RegionListers.CheckDuplicates(current2.ListerThings.AllThings, current2, false);
     }
 }
コード例 #6
0
ファイル: DebugAutotests.cs プロジェクト: KraigXu/GameProject
 private static void CheckRegionListers()
 {
     Autotests_RegionListers.CheckBugs(Find.CurrentMap);
 }