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; } }
public void DeleteHuman(string fullname) { for (int i = 0; i < Humans.Count; i++) { if (Humans[i].fullname == fullname) { Humans.RemoveAt(i); break; } } }
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); }
/// <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(); } } }
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(); }
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"); }
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)); }
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(); }
public override void RemoveHumans() { if (charCount > 0) { charCount--; Humans[Humans.Count - 1].DontWork(); Humans.Remove(Humans[Humans.Count - 1]); if (charCount == 0) { StopCoroutine(PlusCount()); } } }
private void InfektionVerbreiten() { Humans.FindAll(e => e.Infected).ForEach(e => { Humans.ForEach(all => { if (Distance(all, e) <= InfectionRadius) { all.Infect(); } }); }); }
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++; } }
// 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); }
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) ); }
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(); }
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); }
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}"; }
/// <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)); }
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(); }
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); }
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); } } } } } }
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); } } }
/// <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); }
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(); }
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); }
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)); }
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(); } }
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()); } }
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 ); }
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) ); }