private bool InterruptsMe(CompLongRangeAnomalyScanner otherScanner) { if (otherScanner == null || otherScanner == this) { return(false); } if (!otherScanner.Active) { return(false); } if (Props.mtbDays != otherScanner.Props.mtbDays) { return(otherScanner.Props.mtbDays < Props.mtbDays); } return(otherScanner.parent.thingIDNumber < parent.thingIDNumber); }
private void CalculateOtherActiveAnomalyScanners() { otherActiveScanners.Clear(); List <Map> maps = Find.Maps; WorldGrid worldGrid = Find.WorldGrid; for (int i = 0; i < maps.Count; i++) { List <Thing> list = maps[i].listerThings.AllThings.Where(t => t.def == parent.def).ToList(); for (int j = 0; j < list.Count; j++) { CompLongRangeAnomalyScanner compLongRangeScanner = list[j].TryGetComp <CompLongRangeAnomalyScanner>(); if (compLongRangeScanner != null && InterruptsMe(compLongRangeScanner)) { Vector3 tileCenter = worldGrid.GetTileCenter(maps[i].Tile); float second = worldGrid.TileRadiusToAngle(compLongRangeScanner.Props.radius); otherActiveScanners.Add(new Pair <Vector3, float>(tileCenter, second)); } } } }