public static NewProductFeature GetBestFeatureUpgradePossibility(GameEntity product, GameContext gameContext) { var marketRequirements = Markets.GetMarketRequirementsForCompany(gameContext, product); var features = GetAllFeaturesForProduct(); var sortedByImportance = features .OrderBy(f => { if (f.IsMonetizationFeature) { return(11); } var rating = GetFeatureRating(product, f.Name); var max = marketRequirements.Features[f.ID]; if (rating >= 10 || rating == max) { return(110); } var rand = Random.Range(0, 1.5f); return(rand + max - rating); }); return(sortedByImportance.FirstOrDefault()); }
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); }