Esempio n. 1
0
 // Token: 0x0600368B RID: 13963 RVA: 0x001A0E1C File Offset: 0x0019F21C
 public static bool TryFindCell(out IntVec3 cell, Map map, ThingDef thingDef, FactionDef factionDef = null)
 {
     //Log.Message(string.Format("Tick: 1"));
     InfestationLikeCellFinder.CalculateLocationCandidates(map, thingDef);
     InfestationLikeCellFinder.LocationCandidate locationCandidate;
     if (!InfestationLikeCellFinder.locationCandidates.TryRandomElementByWeight((InfestationLikeCellFinder.LocationCandidate x) => x.score, out locationCandidate))
     {
         cell = IntVec3.Invalid;
         //Log.Message(string.Format("TryFindCell: {0} From !InfestationLikeCellFinder.TryFindCell(out loc, map)", cell));
         return(false);
     }
     cell = CellFinder.FindNoWipeSpawnLocNear(locationCandidate.cell, map, thingDef, Rot4.North, 2, (IntVec3 x) => InfestationLikeCellFinder.GetScoreAt(x, map, thingDef) > 0f && x.GetFirstThing(map, thingDef) == null && x.GetFirstThing(map, ((ThingDef_HiveLike)thingDef).TunnelDef) == null);
     return(true);
 }