private void OnEnable() { //segmentId = Flagship.productTargetAudience.SegmentId; segmentId = Marketing.GetCoreAudienceId(Flagship); // Mathf.Clamp(Flagship.productPositioning.Positioning, 0, Marketing.GetAudienceInfos().Count); // Marketing.GetAudienceInfos().Where(a => a.ID == ).First().ID; ViewRender(); }
public override void ViewRender() { base.ViewRender(); var audiences = Marketing.GetAudienceInfos(); var product = Flagship; if (!product.hasProduct) { return; } //bool showAudiences = true; bool showAudiences = product.isRelease; if (showAudiences) { SetItems(audiences); } else { // take primary audience only // positioningId will be always less than amount of audiences SetItems(audiences.Where(a => a.ID == Marketing.GetCoreAudienceId(product))); } Teams.UpdateTeamEfficiency(product, Q); }
public override void ViewRender() { base.ViewRender(); var audiences = Marketing.GetAudienceInfos(); if (!product.hasProduct) { return; } //bool showAudiences = true; bool showAudiences = product.isRelease; if (showAudiences) { SetItems(audiences); } else { // take primary audience only // positioningId will be always less than amount of audiences SetItems(audiences.Where(a => a.ID == Marketing.GetCoreAudienceId(product))); } Teams.UpdateTeamEfficiency(product, Q); if (FeatureCap != null) { FeatureCap.text = Visuals.Positive(Products.GetFeatureRatingCap(product).ToString("0.0")); } }
private void OnEnable() { segmentId = Marketing.GetCoreAudienceId(Flagship); ShowAffordableOnly = true; ViewRender(); }
private void OnEnable() { ViewRender(); var TA = Marketing.GetCoreAudienceId(Flagship); ChosenIndex = TA; OnItemSelected(TA); }
public override void ViewRender() { base.ViewRender(); var infos = Marketing.GetAudienceInfos(); //.OrderBy(a => a.Size); // TODO DUPLICATED FROM AudiencesOnMainScreenListView.ViewRender() var audiences = Marketing.GetAudienceInfos(); //bool showAudiences = true; var company = Flagship; bool showAudiences = company.isRelease; if (showAudiences) { SetItems(audiences); } else { // take primary audience only SetItems(audiences.Where(a => a.ID == Marketing.GetCoreAudienceId(company))); } //SetItems(infos); var audience = Marketing.GetAudienceInfos()[segmentId]; var segmentName = audience.Name; var potentialPhrase = $"{Format.Minify(audience.Size)} users"; var incomePerUser = (double)Economy.GetBaseIncomeByMonetizationType(company); // 1L * (segmentId + 1); var worth = (long)(incomePerUser * audience.Size); var worthPhrase = Format.Money(worth, true); AudienceDescription.text = segmentName + $"\n\n<size=30>Potential\n{Visuals.Positive(potentialPhrase)}\n\nIncome\n{Visuals.Positive(worthPhrase)}</size>"; PositionongDescription.text = $"We are making {Marketing.GetPositioningName(company)}"; if (CompaniesInterestedInUsers != null) { //CompaniesInterestedInUsers.text = $"which are interested in {segmentName}"; CompaniesInterestedInUsers.text = $"which are interested in {Marketing.GetPositioningName(company)}"; } //FindObjectOfType<CompaniesFocusingSpecificSegmentListView>().SetSegment(segmentId); }
public override void OnItemSelected(int ind) { base.OnItemSelected(ind); if (AudienceDetailsView != null) { AudienceDetailsView.SetAudience(ind); } if (ChooseTargetAudienceButtonController != null) { //ChooseTargetAudienceButtonController.SetSegment(ind); Draw(ChooseTargetAudienceButtonController, ind != Marketing.GetCoreAudienceId(Flagship)); } if (MarketingChannelsListView != null) { MarketingChannelsListView.SetSegmentId(ind); } }
public void SetEntity(ProductPositioning positioning) { var company = Flagship; PositioningID = positioning.ID; var positionings = Marketing.GetNichePositionings(company); SegmentId = Marketing.GetCoreAudienceId(company); var infos = Marketing.GetAudienceInfos(); var info = infos[SegmentId]; var actualPositioning = Marketing.GetPositioning(Flagship); var selectedPositioning = FindObjectOfType <PositioningManagerView>().Positioning; BorderImage.color = Visuals.GetColorFromString(selectedPositioning.ID == positioning.ID ? Colors.COLOR_CONTROL : Colors.COLOR_NEUTRAL); var worth = Marketing.GetPositioningWorth(company, positioning); bool isOurPositioning = company.productPositioning.Positioning == positioning.ID; var positioningColor = isOurPositioning ? Colors.COLOR_CONTROL : Colors.COLOR_WHITE; Title.text = $"{positioning.name}\nWorth <size=40><b>{Format.Money(worth, true)}</b></size>"; Title.color = Visuals.GetColorFromString(positioningColor); bool ourPositioning = positioning.ID == actualPositioning.ID; if (ourPositioning) { Title.text += $"\n{Visuals.Colorize("(Our positioning)", Colors.COLOR_CONTROL)}"; } //Title.text = Visuals.Colorize($"{positioning.name}\nWorth <size=40><b>{Format.MinifyMoney(worth)}</b></size>", positioningColor); //Title.text = Visuals.Colorize($"{positioning.name} \n<b>{Format.MinifyMoney(worth)}</b>", positioningColor); var competition = Companies.GetCompetitionInSegment(Flagship, Q, positioning.ID); if (!ourPositioning) { var competitors = competition.Count(); var comeptitionColor = Visuals.GetGradientColor(0, 5, competitors, true); if (competitors == 0) { Title.text += "\n" + Visuals.Positive("NO COMPETITION"); } else { Title.text += "\n" + Visuals.Colorize($"{competitors} companies", comeptitionColor); } } Icon.texture = Resources.Load <Texture2D>($"Audiences/{info.Icon}"); if (SegmentAudiencesListView != null) { SegmentAudiencesListView.SetAudiences(positioning); } //AudienceListView.SetAudiences(positioning.Loyalties.Select((l, i) => new { l, i, asda = infos[i] }).Where(pp => ) //bool isTargetAudience = Marketing.IsTargetAudience(company, segmentId); //var audienceColor = Visuals.GetColorFromString(isTargetAudience ? Colors.COLOR_GOLD : Colors.COLOR_WHITE); //if (isTargetAudience) // PanelImage.color = audienceColor; HideChanges(); }