Пример #1
0
 protected abstract bool CheckState(GeneratorInfo generatorInfo);
Пример #2
0
 protected abstract void FillInner(GeneratorInfo generatorInfo);
Пример #3
0
 protected abstract void Invoke(GeneratorInfo generatorInfo);
Пример #4
0
 private void OnGeneratorStateChanged(GeneratorState oldState, GeneratorState newState, GeneratorInfo info)
 {
     UpdateState(info);
 }
Пример #5
0
 internal GeneratorFunctionInfo(AnalysisUnit unit)
     : base(unit)
 {
     _generator = new GeneratorInfo(unit);
 }
Пример #6
0
 private void OnGeneratorEnhanced(GeneratorInfo info)
 {
     UpdateUnlockButtonView(info);
 }
Пример #7
0
 public TestUpToDateChecker(ITestHeaderWriter testHeaderWriter, GeneratorInfo generatorInfo, ProjectSettings projectSettings)
 {
     this.testHeaderWriter = testHeaderWriter;
     this.generatorInfo    = generatorInfo;
     this.projectSettings  = projectSettings;
 }
Пример #8
0
        public void Setup(int generatorId)
        {
            generator = Services.GenerationService.Generators.GetGeneratorInfo(generatorId);
            int researchPrice = generator.ResearchPrice(Planets);

            researchButton.SetListener(() => {
                IPlayerService playerService = Services.PlayerService;

                if (IsNeedShowDependView())
                {
                    Sounds.PlayOneShot(SoundName.click);

                    ViewService.Show(ViewType.DependGeneratorView, new ViewData {
                        ViewDepth = ViewService.NextViewDepth,
                        UserData  = generator
                    });
                }
                else if (playerService.IsEnoughCoins(researchPrice))
                {
                    playerService.RemoveCoins(researchPrice);
                    Services.GenerationService.Research(generator.GeneratorId);
                    transitionParticles.Play();
                    Analytics.CustomEvent(AnalyticsStrings.RESEARCH_ZEPPELIN);
                    Services.GetService <ISoundService>().PlayOneShot(SoundName.Poof);
                }
                else
                {
                    //notEnoughCoinsPopup.GetComponent<NotEnoughCoinsScreen>().Show(generator.Data.CoinPrice);
                    Sounds.PlayOneShot(SoundName.click);
                    Services.ViewService.Show(ViewType.CoinRequiredView, new ViewData {
                        UserData = researchPrice
                    });
                }
            });

            /*
             * if(generator.Data.Type == GeneratorType.Planet ) {
             *  PlanetNameData planetNameData = Services.ResourceService.PlanetNameRepository.GetPlanetNameData(generator.PlanetId);
             *  generatorNameText.text = Services.ResourceService.Localization.GetString(planetNameData?.name) ?? string.Empty;
             *  generatorIconImage.overrideSprite = Services.ResourceService.Sprites.GetObject(planetNameData.icon);
             * } else {
             *  generatorNameText.text = Services.ResourceService.Localization.GetString(generator.Data.Name);
             *
             * }*/
            ViewService.Utils.ApplyGeneratorName(generatorNameText, generator);

            if (generator.Data.Type == GeneratorType.Normal)
            {
                UpdateGeneratorIcon();
            }
            var currentPlanetData = Services.ResourceService.PlanetNameRepository.GetPlanetNameData(Services.PlanetService.CurrentPlanet.Id);

            bg.overrideSprite = Services.ResourceService.GetSpriteByKey(currentPlanetData.research_bg);

            priceText.text = (researchPrice != 0) ? researchPrice.ToString() : string.Empty;
            if (researchPrice != 0)
            {
                coinIconObject?.Activate();
            }
            else
            {
                coinIconObject.Deactivate();
            }


            UpdateResearchButtonInteractability();

            //autoresearch planets
            if (generator.Data.Type == GeneratorType.Planet)
            {
                AutoResearch();
            }
        }
Пример #9
0
 private void OnGeneratorStateChanged(GeneratorState oldState, GeneratorState newState, GeneratorInfo targetGenerator)
 {
     if (generator != null)
     {
         if (generator.IsDependent)
         {
             if (generator.RequiredGeneratorId == targetGenerator.GeneratorId)
             {
                 UpdateResearchButtonInteractability();
             }
         }
     }
 }
Пример #10
0
        /// <summary>Returns if the specified generator needs context</summary>
        /// <param name="Version">The version of the generator to use</param>
        /// <param name="Variant">The variant of the generator to use</param>
        /// <returns>Returns if the specified generator needs context</returns>
        public static Boolean?NeedContext(Int32 Version, Int32 Variant)
        {
            GeneratorInfo Info = UUIDFactory.GetInfo(Version, Variant);

            return(Info.NeedContext);
        }