void SaveProductCompanyMetrics(GameEntity e, int date) { CompanyStatisticsUtils.AddMetrics(gameContext, e, new MetricsInfo { Date = date, AudienceSize = Marketing.GetClients(e), Income = Economy.GetCompanyIncome(gameContext, e), Profit = Economy.GetProfit(gameContext, e), Valuation = Economy.GetCompanyCost(gameContext, e) }); }
private void SaveGroupCompanyMetrics(GameEntity e, int date) { CompanyStatisticsUtils.AddMetrics(gameContext, e, new MetricsInfo { Date = date, AudienceSize = 0, Income = Economy.GetCompanyIncome(gameContext, e), Profit = Economy.GetProfit(gameContext, e), Valuation = Economy.GetCompanyCost(gameContext, e) }); }
public override string RenderHint() { var income = Economy.GetCompanyIncome(Q, SelectedCompany); var maintenance = Economy.GetCompanyMaintenance(Q, SelectedCompany); var bonus = new Bonus <long>("Balance change") .Append("Income", income) //.AppendAndHideIfZero("Maintenance cost", SelectedCompany.hasProduct ? -Economy.GetDevelopmentCost(SelectedCompany, GameContext) : 0) .AppendAndHideIfZero("Maintenance", -maintenance) .MinifyValues(); return(bonus.ToString()); }
public override void ViewRender() { base.ViewRender(); var company = SelectedCompany; // Companies.Get(Q, companyId); int companyId = company.company.Id; // GetComponent<SetTargetCompany>().companyId; Income.text = "$" + Format.Minify(Economy.GetCompanyIncome(Q, company)); IncomeHint.SetHint(GetIncomeDescription(Q, companyId)); Maintenance.text = "$" + Format.Minify(Economy.GetCompanyMaintenance(Q, company)); MaintenanceHint.SetHint(GetMaintenanceDescription(Q, companyId)); }
void Render() { if (niche == null) { return; } SetPanelColor(); var nicheType = niche.niche.NicheType; GetComponent <LinkToNicheInfo>().SetNiche(nicheType); RenderMarketName(nicheType); DescribePhase(); //var growth = NicheUtils.GetAbsoluteAnnualMarketGrowth(GameContext, entity); MonetisationType.text = Enums.GetFormattedMonetisationType(niche); RenderTimeToMarket(); var sumOfBrandPowers = (int)Marketing.GetSumOfBrandPowers(niche, Q); // var profitLeader = Markets.GetMostProfitableCompanyOnMarket(Q, niche); var profit = profitLeader == null ? 0 : Economy.GetProfit(Q, profitLeader); var income = profitLeader == null ? 0 : Economy.GetCompanyIncome(Q, profitLeader); var biggestMaintenance = profitLeader == null ? 0 : Economy.GetCompanyMaintenance(Q, profitLeader); // maintenance Maintenance.text = Visuals.Positive(Format.MinifyMoney(income)); bool canMaintain = Economy.IsCanMaintain(MyCompany, Q, biggestMaintenance); StartCapital.text = Visuals.Colorize(Format.MinifyMoney(biggestMaintenance), canMaintain); // income var ROI = Markets.GetMarketROI(Q, niche); NicheSize.text = profitLeader == null ? "???" : ROI + "%"; NicheSize.color = Visuals.GetColorPositiveOrNegative(profit); }
private string GetGroupIncomeDescription(GameContext context, int companyId) { string description = "Group income:\n"; var holdings = Companies.GetCompanyHoldings(context, companyId, false); foreach (var h in holdings) { var c = Companies.Get(context, h.companyId); string name = c.company.Name; long income = Economy.GetCompanyIncome(context, c); string tiedIncome = Format.Minify(h.control * income / 100); description += $"\n {name}: +${tiedIncome} ({h.control}%)"; } return(description); }
public void Render() { NicheType nicheType = ScreenUtils.GetSelectedNiche(Q); var niche = Markets.GetNiche(Q, nicheType); var profile = niche.nicheBaseProfile.Profile; var rating = Markets.GetMarketRating(niche); SetAmountOfStars.SetStars(rating); var speed = profile.NicheSpeed; //var iteration = (int)speed; //ChangeSpeed.text = $"{iteration} months"; var iteration = Products.GetBaseIterationTime(niche); //var iteration = speed.ToString(); ChangeSpeed.text = iteration + " days"; PotentialMarketSize.text = Format.Money(Markets.GetMarketPotential(niche)); PotentialAudienceSize.text = Format.MinifyToInteger(Markets.GetMarketAudiencePotential(niche)) + " users"; var risk = Markets.GetMarketDemandRisk(Q, nicheType); string riskText = Markets.ShowRiskStatus(risk).ToString(); RiskLabel.text = $"{risk}% ({riskText})"; var demand = Marketing.GetClientFlow(Q, nicheType); // * MarketingUtils.GetMarketingFinancingAudienceReachModifier(MarketingFinancing.High) * 30; Demand.text = Format.MinifyToInteger(demand) + " monthly"; var baseMaintenance = Markets.GetBaseProductMaintenance(Q, niche); Maintenance.text = Format.MinifyMoney(baseMaintenance) + " / month"; //var teamMaintenance = NicheUtils.GetTeamMaintenanceCost(niche); //TeamMaintenance.text = Format.MoneyToInteger(teamMaintenance) + " / month"; TeamMaintenance.text = profile.AppComplexity.ToString(); long maxIncome = 0; if (BiggestIncome != null) { var players = Markets.GetProductsOnMarket(Q, niche.niche.NicheType); if (players.Count() == 0) { BiggestIncome.text = "???"; } else { maxIncome = players.Max(p => Economy.GetCompanyIncome(Q, p)); BiggestIncome.text = Format.Money(maxIncome) + " / month"; } } var start = Markets.GetStartCapital(niche, Q); if (StartCapital != null) { StartCapital.text = Format.Money(start); var showStartCapital = !Companies.HasCompanyOnMarket(MyCompany, nicheType, Q); StartCapital.gameObject.SetActive(showStartCapital); StartCapitalLabel.gameObject.SetActive(showStartCapital); } //var monthlyMaintenance = marketingMaintenance + teamMaintenance; //if (MonthlyMaintenance != null) // MonthlyMaintenance.text = Format.Money(monthlyMaintenance) + " / month"; //if (ROI != null) //{ // var roi = (maxIncome - monthlyMaintenance) * 100 * 12 / (monthlyMaintenance + 1); // ROI.text = $"{roi}% / yearly"; //} }
public override string RenderValue() { return(Format.Money(Economy.GetCompanyIncome(Q, SelectedCompany))); }