Exemplo n.º 1
0
    void RenderIterationProgress()
    {
        var month   = (int)C.PERIOD * 4;
        var ticking = CurrentIntDate % month;

        var gain = Products.GetIterationMonthlyGain(Flagship);       // 4
        // TODO MULTUPLY BY 10? WHY? GOTO ITERATION.CS GetIterationProgress
        var currentPoints = Products.GetIterationProgress(Flagship); // 0...100

        if (gain + currentPoints / 10 > C.ITERATION_PROGRESS)
        {
            gain = C.ITERATION_PROGRESS - currentPoints / 10;
        }

        var gainProgress = gain * 100 * ticking;


        var iterationProgress = currentPoints + gainProgress / month / C.ITERATION_PROGRESS;

        //Debug.LogFormat("gain {0}, gainProg {1}, ticking {2}", gain, gainProgress, ticking);

        /*if (currentPoints > C.ITERATION_PROGRESS)
         *  iterationProgress = 100;*/

        UpgradeFeature.SetProgress(iterationProgress);
    }
Exemplo n.º 2
0
    public override void ViewRender()
    {
        var progress = 15;

        var product = Flagship;

        var core = product.team.Teams[0];

        var mp           = product.companyResource.Resources.managerPoints;
        var needToCreate = Teams.GetPromotionCost(TeamRank.Solo);

        progress = Mathf.Clamp(mp, 0, needToCreate) * 100 / needToCreate;


        var team = product.team.Teams[SelectedTeam];


        bool hasLeadManager = Teams.HasMainManagerInTeam(team);


        bool isCoreTeam = SelectedTeam == 0;

        bool isUpToManagerLimit = Teams.GetDirectManagementCostOfTeam(core, product, Q).Sum() < 1.2f;
        bool grownUp            = isUpToManagerLimit; // Teams.HasRole(WorkerRole.Marketer, core) && Teams.HasRole(WorkerRole.Programmer, core) && isUpToManagerLimit;
        bool hasTeams           = product.team.Teams.Count > 1;

        Draw(Hire, true); // and has enough MP
        Draw(ManagerFocus, hasLeadManager);

        AddNewTeam.SetProgress(progress);
        Draw(AddNewTeam, isCoreTeam && (grownUp || hasTeams));

        Draw(DetachTeam, !isCoreTeam);

        Draw(PromoteTeam, false && Flagship.team.Teams[SelectedTeam].Rank < TeamRank.Department);
    }