Beispiel #1
0
 public DownloadableContent(uint number, StaticString name, uint steamAppId, DownloadableContentType type, bool dynamicActivationEnabled, DownloadableContentSharing sharing, bool introducesNewFaction = false, string introducedFactionName = "") : this(number, name, steamAppId)
 {
     this.Type = type;
     this.IsDynamicActivationEnabled = dynamicActivationEnabled;
     this.Sharing = sharing;
     this.IntroducesNewFaction  = introducesNewFaction;
     this.IntroducedFactionName = introducedFactionName;
 }
Beispiel #2
0
    private IEnumerator RunAsync()
    {
        if (this.EventService != null)
        {
            this.EventService.Notify(new EventBeginTurn(base.GameClient.Game.Turn));
            if (base.GameClient.Game.Turn == 0 && TutorialManager.IsActivated)
            {
                IPlayerControllerRepositoryService service = base.GameClient.Game.Services.GetService <IPlayerControllerRepositoryService>();
                this.EventService.Notify(new EventTutorialGameStarted(service.ActivePlayerController.Empire));
            }
            if (base.GameClient.Game.Turn == 0)
            {
                IDownloadableContentService service2 = Services.GetService <IDownloadableContentService>();
                if (service2 != null)
                {
                    List <DownloadableContent> list = new List <DownloadableContent>();
                    foreach (DownloadableContent downloadableContent in service2)
                    {
                        DownloadableContentType type = downloadableContent.Type;
                        if ((type == DownloadableContentType.Exclusive || type == DownloadableContentType.Personal) && service2.IsShared(downloadableContent.Name))
                        {
                            list.Add(downloadableContent);
                        }
                    }
                    if (list.Count > 0)
                    {
                        for (int i = list.Count - 1; i >= 0; i--)
                        {
                            StaticString key = string.Format("DownloadableContent/{0}/RunOnce/Notified", list[i].Name);
                            if (!Amplitude.Unity.Framework.Application.Registry.GetValue <bool>(key, false))
                            {
                                Amplitude.Unity.Framework.Application.Registry.SetValue <bool>(key, true);
                                this.EventService.Notify(new EventDownloadableContentPresentation(list[i]));
                            }
                        }
                    }
                    Empire clientEmpire = base.GameClient.GetClientEmpire();
                    if (clientEmpire != null && !clientEmpire.Faction.IsCustom && clientEmpire.Faction.IsStandard)
                    {
                        this.EventService.Notify(new EventFactionPresentation(clientEmpire.Faction));
                    }
                }
            }
        }
        SeasonManager seasonManager = base.GameClient.Game.GetService <ISeasonService>() as SeasonManager;

        if (seasonManager != null)
        {
            seasonManager.GameClient_Turn_Begin();
        }
        PillarManager pillarManager = base.GameClient.Game.GetService <IPillarService>() as PillarManager;

        if (pillarManager != null)
        {
            pillarManager.OnBeginTurn();
        }
        TerraformDeviceManager terraformDeviceManager = base.GameClient.Game.GetService <ITerraformDeviceService>() as TerraformDeviceManager;

        if (terraformDeviceManager != null)
        {
            terraformDeviceManager.GameClient_Turn_Begin();
        }
        WorldEffectManager worldEffectManager = base.GameClient.Game.GetService <IWorldEffectService>() as WorldEffectManager;

        if (worldEffectManager != null)
        {
            worldEffectManager.OnBeginTurn();
        }
        LeechManager leechManager = base.GameClient.Game.GetService <ILeechService>() as LeechManager;

        if (leechManager != null)
        {
            leechManager.OnBeginTurn();
        }
        CooldownManager cooldownManager = base.GameClient.Game.GetService <ICooldownManagementService>() as CooldownManager;

        if (cooldownManager != null)
        {
            cooldownManager.OnBeginTurn();
        }
        MapBoostManager mapBoostManager = base.GameClient.Game.GetService <IMapBoostService>() as MapBoostManager;

        if (mapBoostManager != null)
        {
            mapBoostManager.GameClient_OnBeginTurn();
        }
        RegionalEffectsManager regionalEffectsManager = base.GameClient.Game.GetService <IRegionalEffectsService>() as RegionalEffectsManager;

        if (regionalEffectsManager != null)
        {
            regionalEffectsManager.GameClient_Turn_Begin();
        }
        WeatherManager weatherManager = base.GameClient.Game.GetService <IWeatherService>() as WeatherManager;

        if (weatherManager != null)
        {
            weatherManager.GameClient_Turn_Begin();
        }
        int num;

        for (int index = 0; index < base.GameClient.Game.Empires.Length; index = num + 1)
        {
            yield return(base.GameClient.Game.Empires[index].DoPasses("GameClientState_Turn_Begin"));

            base.GameClient.Game.Empires[index].Refresh(true);
            num = index;
        }
        IVisibilityService service3 = base.GameClient.Game.GetService <IVisibilityService>();

        if (service3 != null)
        {
            IPlayerControllerRepositoryService service4 = base.GameClient.Game.GetService <IPlayerControllerRepositoryService>();
            if (service4 != null && service4.ActivePlayerController != null && service4.ActivePlayerController.Empire != null)
            {
                service3.NotifyVisibilityHasChanged((Empire)service4.ActivePlayerController.Empire);
            }
        }
        IVictoryManagementService service5 = base.GameClient.Game.GetService <IVictoryManagementService>();

        if (service5 != null)
        {
            service5.CheckForAlerts(base.GameClient.Game.Turn - 1);
        }
        IWorldPositionningService service6 = base.GameClient.Game.GetService <IWorldPositionningService>();

        if (service6 != null)
        {
            service6.RefreshDefensiveTowerMapForEveryone();
        }
        yield break;
    }