Ejemplo n.º 1
0
        public static Bonus <long> GetChurnBonus(GameContext gameContext, GameEntity c)
        {
            var state = Markets.GetMarketState(gameContext, c.product.Niche);

            var fromProductLevel = Products.GetDifferenceBetweenMarketDemandAndAppConcept(c, gameContext);
            var marketIsDying    = state == MarketState.Death;


            var niche        = Markets.GetNiche(gameContext, c.product.Niche);
            var monetisation = niche.nicheBaseProfile.Profile.MonetisationType;
            var baseValue    = GetChurnRateBasedOnMonetisationType(monetisation);

            var isCompetitorDumping = HasDumpingCompetitors(gameContext, c);

            var retentionImprovement = c.features.features[ProductFeature.Retention];

            return(new Bonus <long>("Churn rate")
                   .RenderTitle()
                   .SetDimension("%")
                   .Append("Base value for " + Enums.GetFormattedMonetisationType(monetisation), baseValue)
                   .Append("Retention features", -retentionImprovement * 2)

                   .AppendAndHideIfZero("DUMPING", c.isDumping ? -100 : 0)
                   .AppendAndHideIfZero("Competitor is DUMPING", isCompetitorDumping ? 15 : 0)

                   .Append($"Concept difference to market ({fromProductLevel})", fromProductLevel * fromProductLevel)
                   .AppendAndHideIfZero("Market is DYING", marketIsDying ? 5 : 0)
                   .Cap(1, 100)
                   );
        }
Ejemplo n.º 2
0
        public static GameEntity CreateProduct(GameContext context, GameEntity product, NicheType nicheType)
        {
            product.AddProduct(nicheType, 0);

            var niche = Markets.Get(context, nicheType);

            // market state
            product.AddNicheState(Markets.GetMarketState(niche), 100);


            // product.AddNicheSegments(Markets.GetNichePositionings(nicheType, context));
            // product.AddNicheBaseProfile(Markets.Get(context, product).nicheBaseProfile.Profile);

            product.AddProductUpgrades(new Dictionary <ProductUpgrade, bool>
            {
                [ProductUpgrade.SimpleConcept] = true,
                [ProductUpgrade.PlatformWeb]   = true,
            });

            // positioning
            var audiences = Marketing.GetAudienceInfos();
            var coreId    = Random.Range(0, audiences.Count);

            product.AddProductPositioning(coreId);

            // development
            product.AddFeatures(new Dictionary <string, float>());
            product.AddSupportUpgrades(new Dictionary <string, int>());
            product.AddExpertise(Random.Range(1, 4));

            Markets.GetMarketRequirementsForCompany(context, product);



            // var serverFeature = Products.GetHighloadFeatures(product)[0];
            // Teams.AddTeamTask(product, ScheduleUtils.GetCurrentDate(context), context, 0, new TeamTaskSupportFeature(serverFeature));

            // clients
            product.AddMarketing(new Dictionary <int, long>());
            product.AddSourceOfClients(new Dictionary <int, long>());
            product.AddCompanyMarketingActivities(new Dictionary <int, long>());

            // Markets.CopyChannelInfosToProductCompany(product, context);

            Marketing.AddClients(product, 50);

            // sphere of interest
            AddFocusNiche(product, nicheType, context);
            AddFocusIndustry(Markets.GetIndustry(nicheType, context), product);

            WrapProductWithAdditionalData(product, context);



            return(product);
        }