예제 #1
0
        public static List <InvestmentGoal> GetCommonGoals(GameEntity company, GameContext Q)
        {
            var goals = new List <InvestmentGoal>();

            #region data
            bool releasedProduct = company.hasProduct && company.isRelease;

            bool isGroup = !company.hasProduct;

            var  income     = Economy.GetIncome(Q, company);
            bool profitable = Economy.IsProfitable(Q, company);

            bool solidCompany = (releasedProduct || isGroup) && income > 100_000;

            // weaker
            GameEntity weakerCompany = Companies.GetWeakerCompetitor(company, Q, true); // null;

            // stronger
            GameEntity strongerCompany = Companies.GetStrongerCompetitor(company, Q, true); // null;

            #endregion

            if (solidCompany)
            {
                goals.Add(new InvestmentGoalGrowCost(Economy.CostOf(company, Q) * 3 / 2));
                goals.Add(new InvestmentGoalGrowProfit(Economy.GetIncome(Q, company) * 3 / 2));

                //goals.Add(InvestorGoalType.GrowCompanyCost);
                //goals.Add(InvestorGoalType.GrowIncome);

                if (!profitable)
                {
                    goals.Add(new InvestmentGoalBecomeProfitable(Economy.GetIncome(Q, company)));
                    //goals.Add(InvestorGoalType.BecomeProfitable);
                }

                if (strongerCompany != null)
                {
                    goals.Add(new InvestmentGoalOutcompeteByIncome(strongerCompany.company.Id, strongerCompany.company.Name));
                    //goals.Add(new InvestmentGoalOutcompeteByCost(strongerCompany.company.Id, strongerCompany.company.Name));


                    //goals.Add(InvestorGoalType.OutcompeteCompanyByIncome);
                    //goals.Add(InvestorGoalType.OutcompeteCompanyByCost);
                    ////goals.Add(InvestorGoalType.OutcompeteCompanyByUsers);
                }
            }

            return(goals);
        }
예제 #2
0
        public static List <InvestmentGoal> GetGroupOnlyGoals(GameEntity company, GameContext Q)
        {
            var goals = new List <InvestmentGoal>();

            var groupGoals = new List <InvestorGoalType>
            {
                InvestorGoalType.AcquireCompany,
                InvestorGoalType.DominateSegment, // 50%+ users
                InvestorGoalType.DominateMarket,  // OWN ALL COMPANIES
                InvestorGoalType.BuyBack,
                InvestorGoalType.IPO,
            };

            #region data
            var income = Economy.GetIncome(Q, company);

            bool solidCompany = income > 50_000;


            GameEntity weakerCompany; // null;
            #endregion

            var daughters = Companies.GetDaughterProducts(Q, company);

            if (solidCompany)
            {
                if (daughters.Any())
                {
                    var flagship            = daughters.First();
                    var flagshipCompetitors = Companies.GetDirectCompetitors(flagship, Q, false);

                    if (flagshipCompetitors.Any())
                    {
                        weakerCompany = flagshipCompetitors.OrderByDescending(c => Economy.CostOf(c, Q)).Last();
                    }
                    else
                    {
                        weakerCompany = Companies.GetWeakerCompetitor(company, Q, true);
                    }

                    // if there are weaker companies
                    if (weakerCompany != null)
                    {
                        var acquisitionGoal = new InvestmentGoalAcquireCompany(weakerCompany.company.Id, weakerCompany.company.Name);

                        if (!CanCompleteGoal(company, Q, acquisitionGoal))
                        {
                            goals.Add(acquisitionGoal);
                        }
                    }
                }
            }


            #region DominateSegment
            //if (solidCompany && company.companyFocus.Niches.Count == 1)
            //{
            //    var first = daughters.First();

            //    var positioning = Marketing.GetPositioning(first);

            //    if (Companies.GetMarketShareOfCompanyMultipliedByHundred(company, Q) < 2)
            //    goals.Add(InvestorGoalType.DominateSegment);

            //}
            #endregion

            if (solidCompany && daughters.Length > 2)
            {
                AddOnce(goals, company, new InvestmentGoalDominateMarket(company.companyFocus.Niches.First()));
            }

            if (Completed(company, InvestorGoalType.DominateMarket))
            {
                return(OnlyGoal(new InvestmentGoalBuyBack()));
            }

            return(goals);
        }