コード例 #1
0
        static void SpawnChannel(long batch, GameContext gameContext, int costInWorkers, bool isFree, ref int i)
        {
            var channelType = RandomEnum <ClientContainerType> .GenerateValue(ClientContainerType.ProductCompany);

            var audience = batch * 100; // * Random.Range(0.85f, 1.1f);

            var relativeCost = Random.Range(0.5f, 3f);

            var e = gameContext.CreateEntity();

            e.AddMarketingChannel(channelType, new ChannelInfo
            {
                ID = i++,

                Audience = audience,
                Batch    = batch,

                costPerAd    = isFree ? 0 : Mathf.Pow(batch, 1.12f) * relativeCost,
                relativeCost = relativeCost,

                costInWorkers = costInWorkers,

                Companies = new Dictionary <int, long>()
            });

            e.AddChannelMarketingActivities(new Dictionary <int, long>());
        }
コード例 #2
0
 public static List <Trait> GenerateRandomTraits()
 {
     return(new List <Trait>
     {
         RandomEnum <Trait> .GenerateValue(),
         RandomEnum <Trait> .GenerateValue(),
         RandomEnum <Trait> .GenerateValue(),
     });
 }
コード例 #3
0
        private static GameEntity CreateCompany(
            GameContext context,
            string name,
            CompanyType companyType,
            Dictionary <int, BlockOfShares> founders,
            HumanFF CEO)
        {
            var company = context.CreateEntity();

            int id = GenerateCompanyId(context);

            company.AddCompany(id, name, companyType);
            company.isAlive = true;

            var culture = GetRandomCorporateCulture();

            company.AddCorporateCulture(culture);


            SetIndependence(company, true);
            company.AddPartnerships(new List <int>());

            company.AddCompanyResourceHistory(new List <ResourceTransaction>());
            company.AddCompanyResource(new TeamResource());
            Companies.SetResources(company, new TeamResource(0, Teams.GetPromotionCost(TeamRank.SmallTeam), 0, 0, 10000), "Initial capital");

            // investments
            company.AddShareholders(founders);
            company.AddInvestmentProposals(new List <InvestmentProposal>());
            company.AddInvestmentRounds(InvestmentRound.Preseed);
            company.AddCompanyGoal(new List <InvestmentGoal>()); // new InvestmentGoalGrowCost(1000000)
            company.AddCompletedGoals(new List <InvestorGoalType>());

            // Branding?
            company.AddBranding(0);

            // teams
            company.AddWorkerOffers(new List <ExpiringJobOffer>());
            company.AddTeam(
                100, 50,
                new Dictionary <int, WorkerRole>(),
                new Dictionary <WorkerRole, int> {
                [WorkerRole.Programmer] = 0
            },
                new List <TeamInfo>(),
                0
                );

            // add team for CEO
            Teams.AddTeam(company, context, TeamType.CrossfunctionalTeam);
            company.team.Teams[0].Workers        = Teams.GetMaxTeamSize(TeamRank.Solo);
            company.team.Teams[0].HiringProgress = 100;


            // CEO
            int CeoID = CEO.HumanComponent.Id;

            CEO.HumanSkillsComponent.Traits.RemoveAll(t => t == Trait.Greedy);

            company.AddCEO(0, CeoID);
            company.AddEmployee(new Dictionary <int, WorkerRole>());

            company.AddTeamEfficiency(new TeamEfficiency());

            Teams.AttachToCompany(company, context, CEO, WorkerRole.CEO, 0);

            Teams.SetJobOffer(CEO, company, new JobOffer(0), 0, context);

            // uniqueness

            company.AddCompanyStrategies(RandomEnum <CompanySettingGrowthType> .GenerateValue(), RandomEnum <CompanySettingAttitudeToWorkers> .GenerateValue(), RandomEnum <CompanySettingControlDesire> .GenerateValue());


            company.AddCompanyFocus(new List <NicheType>(), new List <IndustryType>());

            company.AddMetricsHistory(new List <MetricsInfo>());
            //e.AddCooldowns(new List<Cooldown>());

            return(company);
        }