Exemplo n.º 1
0
 public static CompTempControl GetTempControl(this Room room, TempControlType targetType)
 {
     foreach (var c in room.Cells)
     {
         Building building = c.GetFirstBuilding(room.Map);
         if (building != null && building.Powered())
         {
             var comp = building.GetComp <CompTempControl>();
             if (comp != null)
             {
                 if ((byte)(comp.AnalyzeType() & targetType) != 0)
                 {
                     return(comp);
                 }
             }
         }
     }
     return(null);
 }
 // Token: 0x06000004 RID: 4 RVA: 0x000020A0 File Offset: 0x000002A0
 public static CompTempControl GetTempControl(this Room room, TempControlType targetType)
 {
     foreach (IntVec3 c in room.Cells)
     {
         Building firstBuilding = c.GetFirstBuilding(room.Map);
         bool     flag          = firstBuilding != null && firstBuilding.Powered();
         if (flag)
         {
             CompTempControl comp  = firstBuilding.GetComp <CompTempControl>();
             bool            flag2 = comp != null;
             if (flag2)
             {
                 bool flag3 = (comp.AnalyzeType() & targetType) > TempControlType.None;
                 if (flag3)
                 {
                     return(comp);
                 }
             }
         }
     }
     return(null);
 }
        // Token: 0x06000004 RID: 4 RVA: 0x000020A0 File Offset: 0x000002A0
        public static CompTempControl GetTempControl(this Room room, TempControlType targetType)
        {
            foreach (var c in room.Cells)
            {
                var firstBuilding = c.GetFirstBuilding(room.Map);
                if (firstBuilding == null || !firstBuilding.Powered())
                {
                    continue;
                }

                var comp = firstBuilding.GetComp <CompTempControl>();
                if (comp == null)
                {
                    continue;
                }

                if ((comp.AnalyzeType() & targetType) > TempControlType.None)
                {
                    return(comp);
                }
            }

            return(null);
        }