public List <Building_MobileProjector> GetPoweredAndIdleProjectorsWithGroupId(int groupId) { List <Building_MobileProjector> projectorsList = new List <Building_MobileProjector>(); foreach (Building building in this.Map.listerBuildings.AllBuildingsColonistOfDef(Util_Projector.ProjectorTowerDef)) { Building_MobileProjectorTower projector = building as Building_MobileProjectorTower; if ((projector != null) && (projector.groupId == groupId) && (projector.target == null) && (projector.isRoofed == false) && projector.powerComp.PowerOn) { projectorsList.Add(projector); } } /**foreach (Building building in this.Map.listerBuildings.AllBuildingsColonistOfDef(Util_Projector.ProjectorTurretDef)) * { * Building_MobileProjectorTurret projector = building as Building_MobileProjectorTurret; * if ((projector != null) * && (projector.groupId == groupId) * && (projector.target == null) * && projector.powerComp.PowerOn) * { * projectorsList.Add(projector); * } * }**/ return(projectorsList); }
public override AlertReport GetReport() { List <Map> maps = Find.Maps; for (int mapIndex = 0; mapIndex < maps.Count; mapIndex++) { foreach (Building building in maps[mapIndex].listerBuildings.AllBuildingsColonistOfDef(Util_Projector.ProjectorTowerDef)) { Building_MobileProjectorTower tower = building as Building_MobileProjectorTower; if (tower.isRoofed) { return(AlertReport.CulpritIs(tower)); } } } return(AlertReport.Inactive); }