private void TrySpawnPlantFromMapEdge() { ThingDef plantDef; if (!this.map.Biome.AllWildPlants.TryRandomElementByWeight((ThingDef def) => this.map.Biome.CommonalityOfPlant(def), out plantDef)) { return; } IntVec3 source; if (RCellFinder.TryFindRandomCellToPlantInFromOffMap(plantDef, this.map, out source)) { GenPlantReproduction.TryReproduceFrom(source, plantDef, SeedTargFindMode.MapEdge, this.map); } }
private void TrySpawnPlantFromMapEdge() { ThingDef plantDef = default(ThingDef); IntVec3 source = default(IntVec3); if (this.map.Biome.AllWildPlants.TryRandomElementByWeight <ThingDef>((Func <ThingDef, float>)((ThingDef def) => this.map.Biome.CommonalityOfPlant(def)), out plantDef) && RCellFinder.TryFindRandomCellToPlantInFromOffMap(plantDef, this.map, out source)) { GenPlantReproduction.TryReproduceFrom(source, plantDef, SeedTargFindMode.MapEdge, this.map); } }