Exemplo n.º 1
0
        private void UpdateLook()
        {
            foreach (var female in Humans.Where(m => m.sex == Human.SEX.FEMALE))
            {
                var headLookType = IsBlowJobbing(female) ? LookAtRotator.TYPE.NO : HeadLookType;

                if (LookType != LookAtRotator.TYPE.NO)
                {
                    if (female.eyeLook.CalcType != LookType || (Transform)_eyeLookTargetInfo.GetValue(female.eyeLook) != m_eyeTarget)
                    {
                        // Keep track
                        if (oldEyeLook.IsChecked || currentType == 1)
                        {
                            //Console.WriteLine("SAVING {0}", (Transform)_eyeLookTargetInfo.GetValue(female.eyeLook));

                            oldEyeLook.Target = (Transform)_eyeLookTargetInfo.GetValue(female.eyeLook);
                            oldEyeLook.Type   = female.eyeLook.CalcType;
                        }

                        female.ChangeEyeLook(LookType, m_eyeTarget, true);
                    }
                }

                if (headLookType != LookAtRotator.TYPE.NO)
                {
                    if (female.neckLook.CalcType != headLookType || (Transform)_eyeLookTargetInfo.GetValue(female.neckLook) != m_eyeTarget)
                    {
                        // Keep track
                        if (oldHeadLook.IsChecked || currentHeadType == 1)
                        {
                            //Console.WriteLine("SAVING {0}", (Transform)_eyeLookTargetInfo.GetValue(female.neckLook));
                            oldHeadLook.Target = (Transform)_eyeLookTargetInfo.GetValue(female.neckLook);
                            oldHeadLook.Type   = female.neckLook.CalcType;
                        }

                        female.ChangeNeckLook(headLookType, m_eyeTarget, true);
                    }
                }

                if (LookType == LookAtRotator.TYPE.NO && !oldEyeLook.IsChecked)
                {
                    //Console.WriteLine("RESET LOOK {0} {1}", oldEyeLook.Target, oldEyeLook.Type);
                    female.eyeLook.Change(oldEyeLook.Type, oldEyeLook.Target, true);
                }
                if (headLookType == LookAtRotator.TYPE.NO && !oldHeadLook.IsChecked)
                {
                    //Console.WriteLine("RESET LOOK {0} {1}", oldEyeLook.Target, oldEyeLook.Type);
                    female.neckLook.Change(oldHeadLook.Type, oldHeadLook.Target, true);
                }

                oldHeadLook.IsChecked = true;
                oldEyeLook.IsChecked  = true;
            }
        }
Exemplo n.º 2
0
 public void DeleteHuman(string fullname)
 {
     for (int i = 0; i < Humans.Count; i++)
     {
         if (Humans[i].fullname == fullname)
         {
             Humans.RemoveAt(i);
             break;
         }
     }
 }
Exemplo n.º 3
0
        public static bool IsProductWantsToGrow(GameEntity product, GameContext gameContext)
        {
            if (!product.isIndependentCompany)
            {
                return(false);
            }

            var ambitions = Humans.GetAmbition(gameContext, product.cEO.HumanId);

            return(ambitions == Ambition.RuleCorporation);
        }
Exemplo n.º 4
0
 /// <summary>
 /// When all evacuees have evacuated (reached the Lobby), each guest gets sent back to their room and cleaners will continue cleaning
 /// </summary>
 public void EvacuatingDone()
 {
     if (Humans.TrueForAll(r => r.Position.AreaType == "Lobby") && Evacuating)
     {
         Evacuating = false;
         foreach (Guest guest in Humans.OfType <Guest>())
         {
             guest.Evacuating = false;
             guest.Go_Back();
         }
     }
 }
Exemplo n.º 5
0
    public void SetEntity(GameEntity human)
    {
        _human      = human;
        Salary.text = Format.Money(Humans.GetSalary(human));

        HumanPreview.SetEntity(human.human.Id);

        BorderImage.color = Visuals.Neutral();

        ScreenUtils.SetSelectedHuman(Q, human.human.Id);
        TraitContainer.ViewRender();
    }
Exemplo n.º 6
0
    public override string GetTitle(NotificationMessageManagerRecruiting message)
    {
        var company = Companies.Get(Q, message.CompanyId);
        var human   = Humans.Get(Q, message.HumanId);

        if (message.Successful)
        {
            //return $"{Humans.GetFullName(human)} ";
            return($"Manager left your company");
        }
        return($"{company.company.Name} wants to recruit your worker");
    }
Exemplo n.º 7
0
    public override void ViewRender()
    {
        base.ViewRender();
        var human = SelectedHuman;

        bool hasCompetingOffers = Humans.HasCompetingOffers(human);

        Draw(OffersTitle, hasCompetingOffers);

        SetItems(hasCompetingOffers ? SelectedHuman.workerOffers.Offers : new List <ExpiringJobOffer>());
        //SetItems(SelectedHuman.workerOffers.Offers.Where(o => o.CompanyId != Flagship.company.Id));
    }
Exemplo n.º 8
0
    void Render(GameEntity human)
    {
        var role   = Humans.GetRole(human);
        var rating = Humans.GetRating(Q, human);

        Offer.text      = $"${Format.Minify(JobOffer.Salary)} / week";
        WorkerName.text = $"Hire {Humans.GetFullName(human)}, ({rating}LVL)";
        RoleName.text   = Humans.GetFormattedRole(role);

        RenderProposalStatus(human, rating);

        WorkerOffersListView.ViewRender();
    }
Exemplo n.º 9
0
 public override void RemoveHumans()
 {
     if (charCount > 0)
     {
         charCount--;
         Humans[Humans.Count - 1].DontWork();
         Humans.Remove(Humans[Humans.Count - 1]);
         if (charCount == 0)
         {
             StopCoroutine(PlusCount());
         }
     }
 }
Exemplo n.º 10
0
 private void InfektionVerbreiten()
 {
     Humans.FindAll(e => e.Infected).ForEach(e =>
     {
         Humans.ForEach(all =>
         {
             if (Distance(all, e) <= InfectionRadius)
             {
                 all.Infect();
             }
         });
     });
 }
Exemplo n.º 11
0
 public void KillHuman(int index)
 {
     if (Humans.Count > 0)
     {
         Announcements.Add($"{Humans[index].Name} has died");
         if (Humans[index].IsAdult)
         {
             Couple.BreakUp((Adult)Humans[index]);
         }
         Humans.RemoveAt(index);
         Deaths++;
     }
 }
Exemplo n.º 12
0
    // tweak salary buttons
    void OnEnable()
    {
        var human = SelectedHuman;

        var role   = Humans.GetRole(human);
        var rating = Humans.GetRating(Q, human);

        var baseSalary = Teams.GetSalaryPerRating(rating);

        JobOffer = new JobOffer(baseSalary);

        Render(SelectedHuman);
    }
Exemplo n.º 13
0
    void RenderDisloyalManager(PopupMessageWorkerLeavesYourCompany popup)
    {
        var human = Humans.Get(Q, popup.humanId);

        var role          = Humans.GetRole(human);
        var formattedRole = Humans.GetFormattedRole(role);

        var rating = Humans.GetRating(Q, human);

        RenderUniversalPopup(
            "Manager doesn't want to work in your company anymore!",
            $"{formattedRole} {Humans.GetFullName(human)} ({rating}LVL) will leave your company.\n\n" + Visuals.Negative("Managers leave if they don't like corporate culture"),
            typeof(WorkerLeavesYourCompanyPopupButton)
            );
    }
Exemplo n.º 14
0
        public void GenerateHumans()
        {
            while (CurrentHumans <= MaxHumans)
            {
                Position x = GetFreeRandomField();
                Graphics.UpdateGenerationStatistic(CurrentHumans, MaxHumans);
                Humans.Add(new Human(x.Column, x.Row));
                //Graphics.Draw(x.Row, x.Column, Graphics.Status.Dead);
                CurrentHumans++;
            }
            int index = Generator.Next(0, Humans.Count);

            Humans[index].Infect();
            DrawHumans();
        }
Exemplo n.º 15
0
    public override void Execute()
    {
        var companyId = Popup.companyId;
        var humanId   = Popup.humanId;


        var company = Companies.Get(Q, companyId);
        var human   = Humans.Get(Q, humanId);

        NotificationUtils.ClosePopup(Q);


        Teams.HireManager(company, Q, human, 0);

        NavigateToHuman(humanId);
    }
Exemplo n.º 16
0
    public override string RenderValue()
    {
        var human = SelectedHuman;

        var salary = Teams.GetSalaryPerRating(human);

        if (Humans.IsEmployed(human))
        {
            salary = Humans.GetSalary(human);
        }

        var character = string.Join("\n", human.humanSkills.Traits.Select(t => t.ToString()));

        return($"<b>Salary</b>\n{salary}$");
        //return $"<b>Salary</b>\n{salary}$ \n\n<b>Traits</b>\n{character}";
    }
Exemplo n.º 17
0
 /// <summary>
 /// Checks the first dirty room in the DirtyRooms list, finds the nearest available cleaner and notifies that cleaner
 /// </summary>
 private void CheckDirtyRooms()
 {
     if (DirtyRooms.Count > 0 && Humans.OfType <Cleaner>().Where(c => !c.Cleaning) != null && !Evacuating)
     {
         try
         {
             GetNearestCleaner().GoCleanRoom(DirtyRooms[0]);
             DirtyRooms.Remove(DirtyRooms[0]);
             CheckDirtyRooms();
         }
         catch (Exception e)
         {
             Console.WriteLine(e);
         }
     }
 }
    private void OnEnable()
    {
        var role    = (WorkerRole)GetParameter("role");
        var company = Flagship;
        var team    = company.team.Teams[SelectedTeam];

        var managers = Teams.GetCandidatesForTeam(company, team, Q)
                       .Select(id => Humans.Get(Q, id))
                       .Where(h => Humans.GetRole(h) == role)
        ;

        SetItems(managers);

        // ----------
        RoleBenefit.text = Visuals.Positive(Teams.GetRoleDescription(role, Q, true));
    }
Exemplo n.º 19
0
    public void OnHire()
    {
        var rating = Humans.GetRating(Q, _human);

        var baseSalary = Teams.GetSalaryPerRating(rating);

        var JobOffer = new JobOffer(baseSalary);

        Teams.HireManager(Flagship, Q, _human, SelectedTeam);
        Teams.SetJobOffer(_human, Flagship, JobOffer, SelectedTeam, Q);

        PlaySound(Sound.MoneySpent);

        CloseModal("Candidates");

        Refresh();
    }
Exemplo n.º 20
0
    void Render(int rank)
    {
        Name.text     = Humans.GetFullName(entity);
        Capitals.text = Format.Money(Investments.GetInvestorCapitalCost(Q, entity));

        Rank.text = rank.ToString();
        Age.text  = "54"; // Random.Range(35, 80).ToString();

        SetPanelColor();

        if (entity == Me)
        {
            Panel.color = Visuals.GetColorFromString(Colors.COLOR_YOU);
        }

        GetComponent <LinkToHuman>().SetHumanId(entity.human.Id);
    }
Exemplo n.º 21
0
    protected override void Execute(List <GameEntity> entities)
    {
        var companies = Companies.Get(gameContext); // contexts.game.GetEntities(GameMatcher.AllOf(GameMatcher.Alive, GameMatcher.Company));
        var humans    = Humans.Get(gameContext);


        // maslov pyramid
        //
        // salary
        // interesting tasks
        // career ladder
        // feedback (i am doing useful stuff)
        // influence (become company shareholder)

        foreach (var c in companies)
        {
            //var culture = Companies.GetActualCorporateCulture(c, gameContext);

            // gain expertise and recalculate loyalty
            foreach (var t in c.team.Teams)
            {
                var managers = t.Managers.Select(m => humans.First(h => h.human.Id == m));

                foreach (var human in managers)
                {
                    bool hasTeacherInTeam = managers.Any(m1 => m1.humanSkills.Traits.Contains(Trait.Teacher) && m1.human.Id != human.human.Id);

                    // bigger the value... MORE chances to upgrade
                    var growth = Teams.GetManagerGrowthBonus(human, t, hasTeacherInTeam, gameContext).Sum();

                    var willGrow = Random.Range(0, 100) < growth;

                    if (willGrow)
                    {
                        human.humanSkills.Roles[WorkerRole.CEO]++;

                        if (!human.hasHumanUpgradedSkills)
                        {
                            human.AddHumanUpgradedSkills((int)C.PERIOD - 1);
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 22
0
    void RenderRole(bool drawAsEmployee)
    {
        var role          = Humans.GetRole(human);
        var formattedRole = Humans.GetFormattedRole(role);

        if (RoleText != null)
        {
            RoleText.text = formattedRole;

            if (drawAsEmployee)
            {
                var company = GetCompany();

                var hasWorkerOfSameType = Teams.HasFreePlaceForWorker(company, role);
                RoleText.color = Visuals.GetColorPositiveOrNegative(hasWorkerOfSameType);
            }
        }
    }
Exemplo n.º 23
0
        /// <summary>
        /// Gets next free field in the console
        /// </summary>
        /// <returns>Row and Column in a Dictionary</returns>
        private Position GetFreeField()
        {
            int width  = RunTimeConfig.CWidth;
            int height = RunTimeConfig.CHeight;

            for (int i = 0; i <= height; i++)    // Loop through rows
            {
                for (int j = 0; j <= width; j++) // Loop through columns
                {
                    if (Humans.Find(e => e.Col == j && e.Row == i) == null)
                    {
                        return(new Position(i, j));
                    }
                }
            }

            return(null);
        }
Exemplo n.º 24
0
    public override void ViewRender()
    {
        base.ViewRender();

        var team = Flagship.team.Teams[0];

        var unhappyCoreWorkers = team.Managers.Select(humanId => Humans.Get(Q, humanId))
                                 .Any(human => human.humanCompanyRelationship.Morale < 30 && Teams.GetLoyaltyChangeForManager(human, team, Flagship) < 0);

        var unhappyTeams = Flagship.team.Teams.Any(t => t.isManagedBadly);

        Draw(Bankruptcy, Economy.IsWillBecomeBankruptOnNextPeriod(Q, MyCompany));
        Draw(UnhappyManager, unhappyCoreWorkers);
        Draw(UnhappyTeam, unhappyTeams);
        Draw(PromoteTeam, false);

        RenderIterationProgress();
    }
Exemplo n.º 25
0
    public override Dictionary <int, WorkerRole> Workers()
    {
        var c = GetCompany();

        var teamId = GetComponent <IsCoreTeam>() == null ? SelectedTeam : 0;

        var team = c.team.Teams[teamId];

        var managers = team.Managers;

        var dict = new Dictionary <int, WorkerRole>();

        foreach (var kvp in managers)
        {
            dict[kvp] = Humans.Get(Q, kvp).worker.WorkerRole;
        }

        return(dict);
    }
Exemplo n.º 26
0
        public async Task <IActionResult> Login(Humans human)
        {
            if (ModelState.IsValid)
            {
                Humans human1 = await db.humans.FirstOrDefaultAsync(u => u.Login == human.Login && u.Password == human.Password);

                if (human1 != null)
                {
                    await Authenticate(human.Login); // аутентификация

                    return(RedirectToAction("Index", "Home"));
                }
                else
                {
                    ModelState.AddModelError("", "Некорректные логин и(или) пароль");
                }
            }
            return(View(human));
        }
Exemplo n.º 27
0
        public void Simulate(Stopwatch sw, int processingTime)
        {
            var targetZ = Zombies[rand.Next(0, Zombies.Length - 1)];

            while (Humans.Any() && Zombies.Any() && sw.ElapsedMilliseconds < processingTime)
            {
                if (!Zombies.Any(z => z.Id == targetZ.Id))
                {
                    targetZ = Zombies[rand.Next(0, Zombies.Length - 1)];
                }
                int distance = Ash.Pos.DistanceTo(targetZ.NextPos);
                distance = distance > 3000 ? 1000 : rand.Next(distance - 2000, 1000);

                var angle = Util.ToDegrees(Util.AngleBetween(Ash.Pos, targetZ.NextPos));
                angle  += rand.Next(-10, 10);
                Ash.Pos = Ash.Pos.Move(Util.ToRadians(angle), distance);
                SimulateTurn();
            }
        }
Exemplo n.º 28
0
    public override string RenderValue()
    {
        var ambition = Humans.GetAmbition(Q, SelectedHuman.human.Id);

        switch (ambition)
        {
        case Ambition.EarnMoney:
            return("Wants to make money");

        //case Ambition.RuleProductCompany:
        //    return "Make innovative products";

        case Ambition.RuleCorporation:
            return("Wants to rule the corporation");

        default:
            return(ambition.ToString());
        }
    }
Exemplo n.º 29
0
        private void CreateMotions()
        {
            if (m_nextMotion != null)
            {
                m_motion = m_nextMotion;
            }
            m_nextMotion = new CameraMotion(Humans.First(m => m.sex == Human.SEX.FEMALE));

            if (m_motion == null)
            {
                m_motion = new CameraMotion(Humans.First(m => m.sex == Human.SEX.FEMALE));
            }

            illusionCamera.Set(
                m_motion.Focus,
                m_motion.Rotation,
                m_motion.Distance
                );
        }
Exemplo n.º 30
0
    void RenderDefectedManager(PopupMessageWorkerWantsToWorkInYourCompany popup)
    {
        var human = Humans.Get(Q, popup.humanId);

        var role          = Humans.GetRole(human);
        var formattedRole = Humans.GetFormattedRole(role);

        var rating = Humans.GetRating(Q, human);

        RenderUniversalPopup(
            "You can hire new manager from your competitors!",

            $"<b>{formattedRole}</b> {Humans.GetFullName(human)} <b>({rating}LVL)</b> will join your company.\n\n" +
            Visuals.Positive("\n\nDo you want to hire?"),

            typeof(WorkerJoinsYourCompanyPopupButton),
            typeof(ClosePopupNO)
            );
    }