Beispiel #1
0
        private bool HasBuildingNotification()
        {
            // Barracks: if any hero has skill to claim
            if (heroService.AllHeroes().Exists(h => h.skillPoints > 0))
            {
                return(true);
            }
            // Laboratory: if any incubator is finished
            if (incubatorService.Incubators.Exists(i => i.finished))
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private void InitHeroes()
        {
            heroService.AllHeroes().ForEach(hero =>
            {
                var heroPrefab = Instantiate(heroAvatarPrefab, heroListContainer);
                heroPrefab.SetHero(hero, indicateAvailability: true);
                if (hero.IsAvailable())
                {
                    heroPrefab.SetActive(IsHeroSelected(hero));
                    heroPrefab.AddClickListener(() => { ToggleHero(hero); });
                }

                heroPrefabs.Add(hero.id, heroPrefab);
            });
        }
        public void SetExpedition(Expedition exp)
        {
            expedition = exp;
            var expSpeedup = progressService.Progress.expeditionSpeed - 100;

            InitTeam();
            title.text        = expedition.expeditionBase.name;
            description.text  = expedition.expeditionBase.description;
            durationText.text = $"Duration: {expedition.expeditionBase.durationHours}h{(expSpeedup > 0 ? $" ({expSpeedup}% speedup)" : "")}";
            xpText.text       = $"{expedition.expeditionBase.xp} XP";

            heroService.AllHeroes().ForEach(hero =>
            {
                var heroPrefab = Instantiate(heroAvatarPrefab, heroListContainer);
                heroPrefab.SetHero(hero, indicateAvailability: true);
                if (hero.IsAvailable())
                {
                    heroPrefab.SetActive(IsHeroSelected(hero));
                    heroPrefab.AddClickListener(() => { heroPrefab.SetActive(ToggleHero(hero)); });
                }

                heroPrefabs.Add(hero.id, heroPrefab);
            });
        }