Beispiel #1
0
    public override void Execute()
    {
        var product = Flagship;

        var featureName = FeatureView.NewProductFeature.Name;

        if (!Products.IsUpgradingFeature(product, featureName))
        {
            var relay = FindObjectOfType <FlagshipRelayInCompanyView>();

            var task = new TeamTaskFeatureUpgrade(FeatureView.NewProductFeature);

            relay.AddPendingTask(task);

            var featureList = FindObjectOfType <RenderAllAudienceNeededFeatureListView>();

            if (featureList != null)
            {
                // view render to recalculate features count
                featureList.ViewRender();

                if (featureList.count == 0)
                {
                    CloseModal("Features");
                    // CloseMyModalWindowIfListIsBlank
                }
            }
        }

        FeatureView.ViewRender();
    }
Beispiel #2
0
    public override void Execute()
    {
        ScheduleUtils.ResumeGame(Q);

        var features = Products.GetUpgradeableRetentionFeatures(Flagship);

        var task = new TeamTaskFeatureUpgrade(features.First());

        Teams.AddTeamTask(Flagship, CurrentIntDate, Q, 0, task);

        //Cooldowns.AddTask(Q, new CompanyTaskUpgradeFeature(Flagship.company.Id, new NewProductFeature()))
    }
Beispiel #3
0
    //public void ShowRetentionFeatures()
    //{
    //    RetentionFeatures = true;

    //    ViewRender();
    //}

    //public void ShowMonetisationFeatures()
    //{
    //    RetentionFeatures = false;

    //    ViewRender();
    //}

    public override void ViewRender()
    {
        base.ViewRender();

        var company = Flagship;

        var retentionFeatures    = Products.GetUpgradeableRetentionFeatures(company);
        var monetisationFeatures = Products.GetUpgradeableMonetizationFeatures(company);

        List <NewProductFeature> features = new List <NewProductFeature>();

        if (RetentionFeatures)
        {
            features.AddRange(retentionFeatures);
        }

        if (MonetizationFeatures)
        {
            features.AddRange(monetisationFeatures);
        }

        // ----------------------------------------------------
        var p           = new TeamTaskFeatureUpgrade(features.FirstOrDefault());
        var activeTasks = Teams.GetActiveSameTaskTypeSlots(company, p);

        var pending = Teams.GetPendingSameTypeTaskAmount(company, p);


        AmountOfFeatures.text = $"{activeTasks}";
        if (pending > 0)
        {
            AmountOfFeatures.text += $"+{Visuals.Colorize(pending.ToString(), "orange")}";
        }

        Draw(PendingTaskIcon, pending > 0);

        AmountOfSlots.text = Visuals.Colorize((long)Teams.GetOverallSlotsForTaskType(company, p));
        // ----------------------------------------------------

        SetItems(features);
    }