Example #1
0
    void RenderDoYouReallyWantToCreateAPrototype(PopupMessageDoYouWantToCreateApp popup)
    {
        // check if has enough resources
        var maintenance = Markets.GetBiggestMaintenanceOnMarket(Q, popup.NicheType);

        bool hasResources = Economy.IsCanMaintain(MyCompany, Q, maintenance);

        var title = "Do you really want to create a new " + Enums.GetFormattedNicheName(popup.NicheType) + "?";
        //var description = $"We need at least {Format.Money(startCapital)} to create a product, which meets market requirements";
        var description = $"On release, this product will cost you about {Format.Money(maintenance)} each month";

        if (maintenance == 0)
        {
            description = "We don't know, how much it will cost on release. Create app to find out! Be the innovator!";
        }


        var resourceText = "";

        if (!hasResources && Companies.GetDaughterCompaniesAmount(MyCompany, Q) > 0)
        {
            resourceText = Visuals.Negative("\nIt's too expensive!");
        }


        RenderUniversalPopup(
            title,
            description + resourceText,
            typeof(CreateAppPopupButton),
            typeof(ClosePopupCancel)
            );
    }
Example #2
0
    public override string RenderValue()
    {
        var hasCompany = Companies.HasCompanyOnMarket(MyCompany, SelectedNiche, Q);

        if (hasCompany)
        {
            var control         = Companies.GetControlInMarket(MyCompany, SelectedNiche, Q);
            var previousControl = Companies.GetDaughtersOnMarket(MyCompany, SelectedNiche, Q)
                                  .Select(p => Companies.GetProductCompanyResults(p, Q))
                                  .Select(r => r.MarketShareChange)
                                  .Sum();

            var diff = (long)(previousControl);

            return($"{control}% ({Visuals.PositiveOrNegativeMinified(diff)}%)");
        }
        else
        {
            var maintenance = Markets.GetBiggestMaintenanceOnMarket(Q, SelectedNiche);

            return(Visuals.Colorize(Format.Money(maintenance), Economy.IsCanMaintain(MyCompany, Q, maintenance)));
        }
    }