void CalculateROI(GameEntity company) { // calculate ROI var allChannels = Markets.GetAllMarketingChannels(Q); maxROI = allChannels.Max(c => Marketing.GetChannelCostPerUser(company, c.marketingChannel.ChannelInfo.ID)); minROI = allChannels.Min(c => Marketing.GetChannelCostPerUser(company, c.marketingChannel.ChannelInfo.ID)); }
void RenderCost(GameEntity company) { var channelId = channel.ID; var adCost = Marketing.GetChannelCost(company, channelId); var clientCost = Marketing.GetChannelCostPerUser(company, channelId); var repaymentColor = Visuals.GetGradientColor(minCost, maxCost, clientCost, true); var canMaintain = Economy.IsCanMaintainForAWhile(MyCompany, Q, adCost, 1); var isFreeChannel = adCost == 0; Cost.text = isFreeChannel ? "FREE" : $"{Format.Money(adCost, true)} weekly"; // (${clientCost.ToString("0.00")} each) Cost.color = Visuals.GetColorPositiveOrNegative(canMaintain); CostPerUser.text = $"{clientCost:0.0}$"; CostPerUser.color = repaymentColor; }