Exemplo n.º 1
0
        private IEnumerator LoadDefaultsImpl()
        {
            yield return(new WaitUntil(() => Services.ResourceService.IsLoaded));

            yield return(new WaitUntil(() => Services.GameModeService.IsLoaded));

            Managers.Clear();
            foreach (var data in Services.ResourceService.Managers.ManagerCollections)
            {
                GeneratorData generatorData = Services.ResourceService.Generators.GetGeneratorData(data.Id);
                Managers.Add(data.Id, new ManagerInfo(data, generatorData));
            }
            if (Services.GameModeService.IsFirstTimeLaunch)
            {
                SetCashOnHand(0, kFirstManagerCashOnHand);
            }

            ManagerEfficiencyRollbackLevels.Clear();

            IsLoaded = true;
        }
Exemplo n.º 2
0
        public override void LoadSave(object obj)
        {
            ManagerServiceSave save = obj as ManagerServiceSave;

            if (save != null)
            {
                if (save.managers != null)
                {
                    Managers.Clear();
                    foreach (var kvp in save.managers)
                    {
                        var           managerData   = Services.ResourceService.Managers.GetManagerData(kvp.Key);
                        GeneratorData generatorData = Services.ResourceService.Generators.GetGeneratorData(kvp.Key);
                        ManagerInfo   manager       = new ManagerInfo(managerData, generatorData, kvp.Value);
                        Managers.Add(manager.Id, manager);
                    }

                    save.Validate();
                    ManagerEfficiencyRollbackLevels.Clear();
                    foreach (var me in save.efficiencyRollbackImproveLevels)
                    {
                        ManagerEfficiencyRollbackLevels.Add(me.Key, new ManagerEfficiencyRollbackLevel(me.Value));
                    }

                    IsLoaded = true;
                }
                else
                {
                    LoadDefaults();
                }
            }
            else
            {
                LoadDefaults();
            }
        }
Exemplo n.º 3
0
 private void ResetByGameplay()
 {
     BaseReset();
     ManagerEfficiencyRollbackLevels.Clear();
     IsLoaded = true;
 }