Exemplo n.º 1
0
        public List <Building_Projector> GetPoweredAndIdleProjectorsWithGroupId(int groupId)
        {
            List <Building_Projector> projectorsList = new List <Building_Projector>();

            foreach (Building building in this.Map.listerBuildings.AllBuildingsColonistOfDef(Util_Projector.ProjectorTowerDef))
            {
                Building_ProjectorTower projector = building as Building_ProjectorTower;
                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_ProjectorTurret projector = building as Building_ProjectorTurret;
                if ((projector != null) &&
                    (projector.groupId == groupId) &&
                    (projector.target == null) &&
                    projector.powerComp.PowerOn)
                {
                    projectorsList.Add(projector);
                }
            }
            return(projectorsList);
        }
Exemplo n.º 2
0
        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_ProjectorTower tower = building as Building_ProjectorTower;
                    if (tower.isRoofed)
                    {
                        return(AlertReport.CulpritIs(tower));
                    }
                }
            }
            return(AlertReport.Inactive);
        }