예제 #1
0
        private bool ShouldSwitchBuildingLightsOff(ushort buildingId, ItemClass.Service service, ItemClass.SubService subService)
        {
            switch (service)
            {
            case ItemClass.Service.None:
                return(false);

            case ItemClass.Service.Residential:
                float currentHour = timeInfo.CurrentHour;
                return(currentHour < Math.Min(config.WakeUpHour, EarliestWakeUp) || currentHour >= config.GoToSleepHour);

            case ItemClass.Service.Office when buildingManager.GetBuildingLevel(buildingId) != ItemClass.Level.Level1:
                return(false);

            case ItemClass.Service.Commercial when subService == ItemClass.SubService.CommercialLeisure:
                return(IsNoiseRestricted(buildingId));

            case ItemClass.Service.Commercial
                when subService == ItemClass.SubService.CommercialHigh && buildingManager.GetBuildingLevel(buildingId) != ItemClass.Level.Level1:
                return(false);

            case ItemClass.Service.Monument:
                return(false);

            case ItemClass.Service.Beautification when subService == ItemClass.SubService.BeautificationParks:
                byte parkId = buildingManager.GetParkId(buildingId);
                if (parkId == 0 || (buildingManager.GetParkPolicies(parkId) & DistrictPolicies.Park.NightTours) == 0)
                {
                    goto default;
                }

                return(false);

            default:
                return(!workBehavior.IsBuildingWorking(service, subService));
            }
        }