Beispiel #1
0
        public static void ShuffleEmployees(GameEntity company, GameContext gameContext)
        {
            //Debug.Log("ShuffleEmployees: " + company.company.Name + " " + company.company.Id);

            // remove previous employees
            foreach (var humanId in company.employee.Managers.Keys)
            {
                var h = Humans.Get(gameContext, humanId);

                h.Destroy();
            }

            company.employee.Managers.Clear();

            var roles = GetRolesTheoreticallyPossibleForThisCompanyType(company);

            int managerTasks = company.team.Teams.Count(t => t.ManagerTasks.Contains(ManagerTask.Recruiting));

            foreach (var role in roles)
            {
                AddEmployee(company, gameContext, managerTasks, role);

                if (role == WorkerRole.Marketer || role == WorkerRole.Programmer)
                {
                    AddEmployee(company, gameContext, managerTasks, role);
                }
            }
        }
        public static void TurnProductToPlayerFlagship(GameEntity company, GameContext Q, NicheType nicheType, GameEntity parentCompany)
        {
            company.isFlagship = true;
            AttachToPlayer(company);
            company.AddChannelExploration(new Dictionary <int, int>(), new List <int>(), 1);

            // give bad positioning initially
            var infos = Marketing.GetAudienceInfos();

            Marketing.AddClients(company, -50);

            var positionings      = Markets.GetNichePositionings(nicheType, Q);
            var positioningWorths = positionings.OrderBy(Markets.GetPositioningValue);

            // TODO POSITIONING
            var rand           = Random.Range(0, 2);
            var newPositioning = rand < 1 ? 0 : 3; //  positioningWorths.ToArray()[rand].ID;

            // 0 - teens, 3 - old people

            Marketing.ChangePositioning(company, Q, newPositioning);

            Marketing.AddClients(company, 50);

            // give good salary to CEO, so he will not leave company
            var CEO        = Humans.Get(Q, GetCEOId(company));
            var GroupCeoID = GetCEOId(parentCompany);

            CEO.AddPseudoHuman(GroupCeoID);

            // var salary = Teams.GetSalaryPerRating(CEO);
            // Teams.SetJobOffer(CEO, company, new JobOffer(salary), 0, Q);
        }
Beispiel #3
0
        public static GameEntity GetSelectedHuman(GameContext gameContext)
        {
            var obj = GetInteger(gameContext, C.MENU_SELECTED_HUMAN);

            var humanId = obj;

            return(Humans.Get(gameContext, humanId));
        }
Beispiel #4
0
        // TODO duplicates? This seems more effective
        public static GameEntity GetWorkerByRole(WorkerRole role, TeamInfo teamInfo, GameContext gameContext)
        {
            foreach (var pair in teamInfo.Roles)
            {
                if (pair.Value == role)
                {
                    return(Humans.Get(gameContext, pair.Key));
                }
            }

            return(null);
        }
Beispiel #5
0
        public static void AutoFillShareholders(GameContext gameContext, GameEntity c, bool founderOnly)
        {
            var founder     = c.cEO.HumanId;
            var shareholder = Humans.Get(gameContext, founder);

            Investments.BecomeInvestor(gameContext, shareholder, 100000);

            AddShares(c, shareholder, 500);

            if (founderOnly)
            {
                return;
            }

            for (var i = 0; i < UnityEngine.Random.Range(1, 5); i++)
            {
                var investor = Investments.GetRandomInvestmentFund(gameContext);

                AddShares(c, investor, 100);
            }
        }
Beispiel #6
0
 public static void FireManager(GameEntity company, GameContext gameContext, int humanId) => FireManager(company, Humans.Get(gameContext, humanId));