Exemple #1
0
    public void SetFeature(NewProductFeature newProductFeature, AudiencesOnMainScreenListView audiencesOnMainScreenListView)
    {
        NewProductFeature = newProductFeature;
        _AudiencesOnMainScreenListView = audiencesOnMainScreenListView;

        ViewRender();
    }
Exemple #2
0
        public static float GetLoyaltyChangeFromFeature(GameEntity c, NewProductFeature f, int segmentId, bool maxChange = false)
        {
            var rating   = Products.GetFeatureRating(c, f.Name);
            var attitude = f.AttitudeToFeature[segmentId];

            if (maxChange)
            {
                if (attitude <= 0)
                {
                    rating = 0;
                }
                else
                {
                    rating = 10;
                }
            }

            var loyaltyGain = 0f;

            if (attitude >= 0)
            {
                // is a feature
                loyaltyGain = rating * attitude / 10;
            }
            else
            {
                // is monetizing
                loyaltyGain = attitude;
                //loyaltyGain = attitude + (10 - rating) * attitude / 10;
            }

            return(loyaltyGain);
        }
Exemple #3
0
    public CompanyTaskUpgradeFeature(int companyId, NewProductFeature improvement)
    {
        CompanyId       = companyId;
        CompanyTaskType = CompanyTaskType.UpgradeFeature;

        ProductImprovement = improvement;
    }
Exemple #4
0
 public void ShowAudienceLoyaltyChangeOnFeatureUpgrade(NewProductFeature f)
 {
     foreach (var preview in Items)
     {
         preview.GetComponent <AudiencePreview>().ShowChanges(f);
     }
 }
Exemple #5
0
        public static bool IsLeadingInFeature(GameEntity Flagship, NewProductFeature Feature, GameContext Q)
        {
            //var competitors = Companies.GetDirectCompetitors(Flagship, Q, true);

            //return IsLeadingInFeature(Flagship, Feature, Q, competitors);
            var index = GetAllFeaturesForProduct().ToList().FindIndex(f => f.Name == Feature.Name);

            return(Flagship.marketRequirements.Features[index] <= GetFeatureRating(Flagship, Feature.Name));
        }
Exemple #6
0
        public static bool IsFeatureMaxedOut(GameEntity company, NewProductFeature f)
        {
            var ratingCap  = GetFeatureRatingCap(company);
            var ratingGain = GetFeatureRatingGain(company);

            var rating = GetFeatureRating(company, f.Name);

            ratingCap = 10;

            return(rating + ratingGain > ratingCap);
        }
Exemple #7
0
        public static NewProductFeature[] GetAllFeaturesForProduct()
        {
            //Needs messaging, profiles, friends, voice chats, video chats, emojis, file sending
            // Test Audience, Teenagers, Adults, Middle, Old

            var hate = C.FEATURE_VALUE_HATE;

            var socialNetworkFeatures = GenerateFeatureList(
                new List <string> {
                "Messaging"
            },
                new List <string> {
                "News Feed", "Friends", "Profile", "Audio chat", "Video chat"
            },
                new List <string> {
                "Sending files", "Emojis", "Likes"
            },
                0,
                NewProductFeature.SimpleFeature("Ads", hate, 100),
                NewProductFeature.SimpleFeature("Panel for advertisers", 0, 25)
                );

            // var gamingCompanyFeatures = GenerateFeatureList(
            //     new List<string> {"Core game"},
            //     new List<string> {"Multiplayer", "Different playing strategies", "Locations"},
            //     new List<string> {"Website", "some feature 1"}, 25,
            //     NewProductFeature.SimpleFeature("Ads", hate, 100),
            //     NewProductFeature.SimpleFeature("Microtranzactions", hate / 2, 50),
            //     NewProductFeature.SimpleFeature("Skins", hate / 5, 40)
            // );

            //var featureList = new List<NewProductFeature>();
            //switch (product.product.Niche)
            //{
            //    case NicheType.ECom_Exchanging:
            //        featureList.Add(new NewProductFeature(""))
            //        break;
            //}

            return(socialNetworkFeatures);
        }
Exemple #8
0
    internal void SetEntity(NewProductFeature newProductFeature)
    {
        Feature = newProductFeature;

        var competitors = Markets.GetProductsOnMarket(Q, Flagship);

        var maxLVL = Markets.GetMaxFeatureLVL(competitors, Feature.Name); // competitors.Max(c => Products.GetFeatureRating(c, Feature.Name));
        var rating = Products.GetFeatureRating(Flagship, Feature.Name);

        //var marketRequirements = Markets.GetMarketRequirementsForCompany(Q, Flagship);
        //var featureIndex = Products.GetAllFeaturesForProduct().Select(f => f.Name).ToList().IndexOf(Feature.Name);

        var maxFeature = (int)maxLVL; // marketRequirements.Features[featureIndex];

        FeatureName.text = Feature.Name;

        Rating.text  = rating + " / " + maxFeature + "LVL";
        Rating.color = Visuals.GetGradientColor(0, maxFeature, rating);

        RenderFeatureBenefit(rating);

        // Set up controller
        UpgradeFeatureController.SetEntity(Feature);


        // Hide
        var leader = competitors.First(c => Products.GetFeatureRating(c, Feature.Name) == maxLVL);

        var companyName = leader.company.Name;

        Leader.text  = Visuals.Colorize(companyName, leader.isFlagship ? Colors.COLOR_BEST : Colors.COLOR_NEUTRAL) + "\n" + (int)maxLVL;
        You.text     = "" + rating;
        Benefit.text = $"+{Visuals.Positive("5% growth")}";


        var space    = "      ";
        var upgrades = competitors.Select(c => Visuals.Colorize((int)Products.GetFeatureRating(c, Feature.Name) + "", c.isFlagship ? Colors.COLOR_BEST : Colors.COLOR_NEUTRAL));

        Upgrades.text = string.Join($"{space}|{space}", upgrades);
        Hide(Upgrades);
    }
Exemple #9
0
        private static NewProductFeature[] GenerateFeatureList(List <string> UTPs, List <string> TOPs, List <string> OKs, int randomFeatures, params NewProductFeature[] features)
        {
            var featureList = new List <NewProductFeature>();

            featureList.AddRange(UTPs.Select(s => NewProductFeature.SimpleFeature(s, C.FEATURE_VALUE_UTP)));
            featureList.AddRange(TOPs.Select(s => NewProductFeature.SimpleFeature(s, C.FEATURE_VALUE_TOP)));
            featureList.AddRange(OKs.Select(s => NewProductFeature.SimpleFeature(s, C.FEATURE_VALUE_OK)));

            for (var i = 0; i < randomFeatures; i++)
            {
                featureList.Add(NewProductFeature.SimpleFeature($"Random feature: {i}", C.FEATURE_VALUE_OK));
            }

            featureList.AddRange(features);

            // Patch with IDs
            for (var i = 0; i < featureList.Count; i++)
            {
                featureList[i].ID = i;
            }

            return(featureList.ToArray());
        }
Exemple #10
0
        /*public static bool IsLeadingInFeature(GameEntity Flagship, NewProductFeature Feature, GameContext Q, IEnumerable<GameEntity> competitors)
         * {
         *  //var maxLVL = competitors.Max(c => GetFeatureRating(c, Feature.Name));
         *
         *  //return GetFeatureRating(Flagship, Feature.Name) == maxLVL;
         * }*/

        // in percents 0...15%
        public static float GetFeatureMaxBenefit(GameEntity product, NewProductFeature feature)
        {
            return(GetFeatureActualBenefit(10, feature));
        }
 public static void TryToUpgradeFeature(GameEntity product, NewProductFeature feature, GameContext gameContext) => TryToUpgradeFeature(product, feature.Name, gameContext);
Exemple #12
0
    public void ShowChanges(NewProductFeature f)
    {
        int change = (int)Marketing.GetLoyaltyChangeFromFeature(Flagship, f, segmentId, true);

        ShowChanges(change);
    }
Exemple #13
0
 internal void SetEntity(NewProductFeature feature)
 {
     this.feature = feature;
 }
 public TeamTaskFeatureUpgrade(NewProductFeature NewProductFeature)
 {
     this.NewProductFeature = NewProductFeature;
 }
Exemple #15
0
 public static bool IsMonetizationFeature(NewProductFeature f) => f.FeatureBonus is FeatureBonusMonetization;
Exemple #16
0
 // feature benefits
 public static float GetFeatureActualBenefit(GameEntity product, NewProductFeature feature)
 {
     return(GetFeatureActualBenefit(GetFeatureRating(product, feature.Name), feature));
 }
Exemple #17
0
 public static float GetFeatureActualBenefit(float rating, NewProductFeature feature)
 {
     return(rating * feature.FeatureBonus.Max / 10f);
 }
Exemple #18
0
        // if maxChange = true
        // this will return max loyalty for regular features
        // and worst loyalty hit for monetization features

        // otherwise - upgraded values?
        public static float GetLoyaltyChangeFromFeature(GameEntity c, NewProductFeature f)
        {
            return(100);
        }