コード例 #1
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);
        }
コード例 #2
0
ファイル: AttachToGroup.cs プロジェクト: dqchess/Corporations
        public static void AttachToGroup(GameContext context, int parentId, int subsidiaryId)
        {
            // TODO only possible if independent!

            var parent = Get(context, parentId);


            // we cannot attach company to product company
            if (!IsCompanyGroupLike(parent))
            {
                return;
            }

            var daughter = Get(context, subsidiaryId);

            if (daughter.hasProduct)
            {
                AddFocusNiche(daughter.product.Niche, parent, context);
                var industry = Markets.GetIndustry(daughter.product.Niche, context);

                AddFocusIndustry(industry, parent);
            }


            //Debug.Log("Attach " + daughter.company.Name + " to " + parent.company.Name);

            var shareholders = new Dictionary <int, BlockOfShares>
            {
                {
                    parent.shareholder.Id,
                    new BlockOfShares
                    {
                        amount             = 100,
                        InvestorType       = InvestorType.Strategic,
                        shareholderLoyalty = 100
                    }
                }
            };

            if (daughter.hasShareholders)
            {
                daughter.ReplaceShareholders(shareholders);
            }
            else
            {
                daughter.AddShareholders(shareholders);
            }

            daughter.isIndependentCompany = false;
        }
コード例 #3
0
        private static float GetPartnershipBonuses(GameEntity product, GameContext gameContext)
        {
            var partners = Companies.GetPartnerList(product, gameContext);

            var industry = Markets.GetIndustry(product.product.Niche, gameContext);


            float value = 0;

            foreach (var p in partners)
            {
                value += Companies.GetBrandProjectionOnIndustry(p, gameContext, industry);
            }

            return(Mathf.Clamp(value, 0, 3));
        }
コード例 #4
0
        public static float GetCompanyStrengthInIndustry(GameEntity company, IndustryType industry, GameContext gameContext)
        {
            if (company.isManagingCompany)
            {
                var daughtersInIndustry = GetDaughterProducts(gameContext, company)
                                          .Where(p => Markets.GetIndustry(p.product.Niche, gameContext) == industry);

                return(daughtersInIndustry
                       .Sum(d => d.branding.BrandPower));
            }
            else
            {
                // product company
                var ind = Markets.GetIndustry(company.product.Niche, gameContext);

                return(ind == industry ? company.branding.BrandPower : 0);
            }
        }
コード例 #5
0
        public static void AttachToGroup(GameContext context, GameEntity parent, GameEntity daughter)
        {
            // TODO only possible if independent!

            // we cannot attach company to product company
            if (parent.hasProduct)
            {
                return;
            }

            if (daughter.hasProduct)
            {
                var industry = Markets.GetIndustry(daughter.product.Niche, context);

                AddFocusNiche(parent, daughter.product.Niche, context);
                AddFocusIndustry(industry, parent);
            }

            // TODO why not make it with transfer shares function?
            RemoveAllShareholders(context, daughter);
            AddShares(daughter, parent, 100);

            SetIndependence(daughter, false);
        }
コード例 #6
0
        public static GameEntity CreateProduct(GameContext context, GameEntity company, NicheType niche)
        {
            company.AddProduct(niche, 0);

            // positioning
            int positionings = Markets.GetNichePositionings(niche, context).Count;

            company.AddProductPositioning(Random.Range(0, positionings));

            // development
            company.AddFeatures(new Dictionary <ProductFeature, int> {
                [ProductFeature.Acquisition] = 0, [ProductFeature.Monetisation] = 0, [ProductFeature.Retention] = 0
            }, 0);
            company.AddExpertise(Random.Range(1, 4));

            company.AddFinancing(new Dictionary <Financing, int> {
                [Financing.Development] = 0, [Financing.Marketing] = 0, [Financing.Team] = 0
            });

            // clients
            var flow        = Marketing.GetBaseClientsForNewCompanies(context, niche);
            var baseClients = Random.Range(0.15f, 0.35f) * flow;

            company.AddMarketing((long)baseClients);

            // sphere of interest
            var industry = Markets.GetIndustry(niche, context);

            AddFocusNiche(niche, company, context);
            AddFocusIndustry(industry, company);


            Investments.SetCompanyGoal(context, company, InvestorGoal.Operationing);

            return(company);
        }
コード例 #7
0
        public static float GetBrandProjectionOnIndustry(GameEntity company, GameContext gameContext, NicheType nicheType)
        {
            var industry = Markets.GetIndustry(nicheType, gameContext);

            return(GetBrandProjectionOnIndustry(company, gameContext, industry));
        }