Ejemplo n.º 1
0
 private void RecalculateBlockages()
 {
     if (this.windPathCells.Count == 0)
     {
         IEnumerable <IntVec3> collection = WindTurbineUtility.CalculateWindCells(base.parent.Position, base.parent.Rotation, base.parent.def.size);
         this.windPathCells.AddRange(collection);
     }
     this.windPathBlockedCells.Clear();
     this.windPathBlockedByThings.Clear();
     for (int i = 0; i < this.windPathCells.Count; i++)
     {
         IntVec3 intVec = this.windPathCells[i];
         if (base.parent.Map.roofGrid.Roofed(intVec))
         {
             this.windPathBlockedByThings.Add(null);
             this.windPathBlockedCells.Add(intVec);
         }
         else
         {
             List <Thing> list = base.parent.Map.thingGrid.ThingsListAt(intVec);
             for (int j = 0; j < list.Count; j++)
             {
                 Thing thing = list[j];
                 if (thing.def.blockWind)
                 {
                     this.windPathBlockedByThings.Add(thing);
                     this.windPathBlockedCells.Add(intVec);
                     break;
                 }
             }
         }
     }
 }
 public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot)
 {
     GenDraw.DrawFieldEdges(WindTurbineUtility.CalculateWindCells(center, rot, def.size).ToList <IntVec3>());
 }