public bool PassesHomeInspection(Common.IStatGenerator stats, Lot lot, ICollection <SimDescription> sims, FindLotFlags flags) { if (lot == null) { return(false); } Dictionary <HomeInspection.Reason, bool> existingResults = new Dictionary <HomeInspection.Reason, bool>(); if (sims != null) { Dictionary <Household, bool> houses = new Dictionary <Household, bool>(); foreach (SimDescription sim in sims) { if ((sim.Household != null) && (!houses.ContainsKey(sim.Household))) { houses.Add(sim.Household, true); if (sim.LotHome != null) { foreach (HomeInspection.Result result in new HomeInspection(sim.LotHome).Satisfies(HouseholdsEx.All(sim.Household))) { existingResults[result.mReason] = true; } } } if (sim.Occupation != null) { if (((flags & FindLotFlags.InspectCareerItems) == FindLotFlags.InspectCareerItems) && (GetValue <CareerObjectInspectionOption, bool>())) { DreamJob job = ManagerCareer.GetDreamJob(sim.Occupation.Guid); if (job != null) { if (!job.Satisfies(Careers, sim, lot, true)) { stats.IncStat("Career Inspection Fail"); return(false); } } } } } } return(PassesHomeInspection(stats, lot, existingResults.Keys, new HomeInspection(lot).Satisfies(sims), flags)); }
public void AddDreamJobDetails(DreamJob DreamJobClient) { var manager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext())); var currentUser = manager.FindById(User.Identity.GetUserId()); int id = currentUser.UserInfo.Id; DreamJob dj = new DreamJob(); dj.UserInfoID = id; dj.companyName = DreamJobClient.companyName; dj.position = DreamJobClient.position; dj.startDate = DreamJobClient.startDate; dj.description = DreamJobClient.description; DreamJobBusinessLayer djBal = new DreamJobBusinessLayer(); djBal.InsertDreamJobDetails(dj); }
public override bool IsHit(SimScoringParameters parameters) { List <DreamJob> dreamJobs = Managers.ManagerCareer.GetDreamJob(parameters.Actor); if (DreamJob.Contains(dreamJobs, mOccupation)) { return(true); } if (dreamJobs.Count == 0) { return(false); } else { return(mOccupation == OccupationNames.Any); } }
private void BtnDreamJobFightClick(object sender, EventArgs e) { arena = DreamJob.Apply(ninja); evil = arena.Creature; this.pnlDreamJob.Visible = false; this.pnlFight.Visible = true; this.DeclareFightButtons(); this.LoadButtons(); this.lblFightNinja.Text = this.ninja.Name; this.lblFightEvil.Text = this.evil.Name; this.prgrsFightNinja.Maximum = this.ninja.TotalEnergy; this.prgrsFightEvil.Maximum = this.evil.TotalEnergy; this.prgrsFightEvil.Value = this.evil.CurrentEnergy; this.prgrsFightNinja.Value = this.ninja.CurrentEnergy; this.temporaryBag = new List <IUsable>(this.ninja.BagOfItems); this.temporaryForceBag = new List <IUsable>(this.ninja.ListOfFightingSkills); this.temporaryMentalBag = new List <IUsable>(this.ninja.ListOfMentalSkills); }
protected override bool Allow(SimDescription sim) { Career career = sim.Occupation as Career; if (career == null) { IncStat("No Job"); return(false); } else if (career.CurLevel == null) { IncStat("No Level"); return(false); } else if (career.CurLevel.LastLevel == null) { IncStat("First Level"); return(false); } else if (career.CurLevel.LastLevel.NextLevels.Count <= 1) { IncStat("Not Branch"); return(false); } if ((!GetValue <PromptOption, bool>()) || (!Careers.MatchesAlertLevel(Sim))) { List <DreamJob> dreams = ManagerCareer.GetDreamJob(Sim); if (dreams.Count == 0) { IncStat("No Dream"); return(false); } else if (!DreamJob.Contains(dreams, career.Guid)) { IncStat("Wrong Job"); return(false); } } return(base.Allow(sim)); }
public void UpdateDreamJob(DreamJob DreamJobClient) { DreamJobBusinessLayer drjobdb = new DreamJobBusinessLayer(); drjobdb.UpdateDreamJobById(DreamJobClient); }