public static void CheckBugs(Map map) { Autotests_RegionListers.CalculateExpectedListers(map); Autotests_RegionListers.CheckThingRegisteredTwice(map); Autotests_RegionListers.CheckThingNotRegisteredButShould(); Autotests_RegionListers.CheckThingRegisteredButShouldnt(map); }
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); } }
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); } } } }
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); } }
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); } }
private static void CheckRegionListers() { Autotests_RegionListers.CheckBugs(Find.CurrentMap); }