public void Set(Career career, Hero hero) { _Career = career; _Hero = hero; LoadCharacter(); }
public override void OnEndOfDay(Career c) { Business business = OmniCareer.Career<Business> (c); if (business != null) { if ((business.SimConspiringPrank != null) && (business.OwnerDescription == business.SimConspiringPrank)) { if (business.IsPrankSet) { base.Display(LocalizeString(business.SimConspiringPrank, "PrankCouldNotBeDone", new object[] { business.SimAffectedByPrank, business.SimConspiringPrank }), business.SimConspiringPrank.CreatedSim.ObjectId, c); business.WasLastPrankSuccessful = false; } if ((business.SimAffectedByPrank != null) && (business.LastPrankedSim != business.SimAffectedByPrank)) { business.LastPrankedSim = business.SimAffectedByPrank; } else { business.LastPrankedSim = null; } business.SimAffectedByPrank = null; business.IsPrankSet = false; } } }
public void LoadModule(D3Cache cache, Career career, Hero hero) { if (hero == null) return; if (hero.Items.MainHand != null) { Item mainHand = cache.GetFullItem(hero.Items.MainHand, career.Region); this.WeaponMainHand.LoadItem(mainHand); } else { this.WeaponMainHand.LoadItem(null); } if (hero.Items.OffHand != null) { Item offHand = cache.GetFullItem(hero.Items.OffHand, career.Region); this.WeaponOffHand.LoadItem(offHand); } else { this.WeaponOffHand.LoadItem(null); } }
public void TestGet() { var repo = new CareerRepository(new MoviesContext()); Career[] careers = new Career[5]; for (int i = 0; i < 5; i++) { careers[i] = new Career { Id = Guid.NewGuid(), Title = "testGetCareer" + i }; repo.Insert(careers[i]); } repo.Save(); var listOfCareers = repo.Get(c => c.Title.StartsWith("testGetCareer")); int j = 0; Assert.AreEqual(listOfCareers.Count(), 5); for (int i = 0; i < 5; i++) { Assert.NotNull(listOfCareers.SingleOrDefault(c => c.Title == careers[j].Title)); } for (int i = 0; i < 5; i++) { repo.Delete(careers[i]); } repo.Save(); }
public override bool IsEligible(Career c) { Business business = OmniCareer.Career<Business>(c); if (business == null) return false; return (business.OwnerDescription == business.SimConspiringPrank); }
public override float FindMetricValue(Career career) { Music music = OmniCareer.Career<Music> (career); if (music == null) return 0; return (float)music.ConcertsPerformed; }
void Start() { display = canvas.GetComponent<Display>(); career = canvas.GetComponent<Career>(); relationship = canvas.GetComponent<Relationship>(); obituary = canvas.GetComponent<Obituary>(); panel.SetActive(false); }
public override float FindMetricValue(Career career) { OmniCareer job = career as OmniCareer; if (job != null) { return (float)job.NumJournalsRead; } return 0f; }
public override float FindMetricValue(Career career) { FortuneTellerCareer fortune = OmniCareer.Career<FortuneTellerCareer>(career); if (fortune != null) { return (float)fortune.PrivateReadingsPerfomed; } return 0f; }
public override float FindMetricValue(Career career) { OmniCareer job = career as OmniCareer; if (job != null) { return (float)job.ShakedownFunds; } return 0f; }
public override string MetricDescription(Career career) { ProSports sports = OmniCareer.Career<ProSports>(career); if (sports != null) { return OmniCareer.LocalizeString(career.OwnerDescription, "DescriptionWinLossRecord", "Gameplay/Careers/Metrics:DescriptionWinLossRecord", new object[] { sports.GamesTillSeasonEnds, sports.GamesWon, sports.GamesLost, sports.GamesWonTotal, sports.GamesLostTotal }); } return ""; }
public override float FindMetricValue(Career career) { ProSports sports = OmniCareer.Career<ProSports>(career); if (sports != null) { return (float)(sports.mWinRecord - sports.mLossRecord); } return 0f; }
public static void InitCashBenefits(Career career) { career.Cash[0] = 500; career.Cash[1] = 1000; career.Cash[2] = 1000; career.Cash[3] = 5000; career.Cash[4] = 8000; career.Cash[5] = 10000; career.Cash[6] = 20000; }
public override float FindMetricValue(Career career) { ProSports sports = OmniCareer.Career <ProSports>(career); if (sports != null) { return((float)(sports.mWinRecord - sports.mLossRecord)); } return(0f); }
internal Career GetById(int id) { Career data = _repo.GetById(id); if (data == null) { throw new Exception("Invalid Id"); } return(data); }
// Methods public bool HasPartner(Career career, out SimDescription partner) { partner = null; LawEnforcement enforcement = OmniCareer.Career<LawEnforcement> (career); if (enforcement != null) { partner = enforcement.Partner; } return (partner != null); }
public override string MetricDescription(Career career) { ProSports sports = OmniCareer.Career <ProSports>(career); if (sports != null) { return(OmniCareer.LocalizeString(career.OwnerDescription, "DescriptionWinLossRecord", "Gameplay/Careers/Metrics:DescriptionWinLossRecord", new object[] { sports.GamesTillSeasonEnds, sports.GamesWon, sports.GamesLost, sports.GamesWonTotal, sports.GamesLostTotal })); } return(""); }
public Career ConvertToEF(CareerDTO DTO) { var EF = new Career() { CareerId = DTO.CareerId, CareerName = DTO.CareerName }; return(EF); }
public IEnumerable <OfferDTO> GetOffers(int careerId) { Career career = Database.Careers.Get(careerId); if (career == null) { throw new ArgumentOutOfRangeException("Not found career"); } return(Mapper.Map <IEnumerable <Offer>, List <OfferDTO> >(career.Offers)); }
internal String Delete(int id, string userId) { Career original = GetById(id); if (original.creatorId != userId) { throw new Exception("Access Denied: Cannot Delete a Career You did not Create"); } _repo.Remove(id); return("successfully deleted"); }
public void TestGetByTitle() { ICareerService service = new CareerService(new CareerRepository(new MoviesContext())); var career = new Career { Id = Guid.NewGuid(), Title = "testGetByTitleCareer" }; service.AddCareer(career); var sameCareer = service.GetCareerByTitle(career.Title); Assert.AreSame(career.Title, sameCareer.Title); service.Delete(career.Id); }
static void Main(string[] args) { var articles = new List <Article>(); articles.Add(new Article("Artigo sobre OOP", "orientacao-objetos")); articles.Add(new Article("Artigo sobre C#", "orientacao-objetos")); articles.Add(new Article("Artigo sobre .NET", "orientacao-objetos")); // foreach (var article in articles) // { // Console.WriteLine(article.Id); // Console.WriteLine(article.Title); // Console.WriteLine(article.Url); // } var courses = new List <Course>(); var courseOOP = new Course("OOP", "fundamentos-oop"); var courseCsharp = new Course("C#", "fundamentos-c#"); var courseAspNet = new Course("OOP", "fundamentos-aspnet"); courses.Add(courseOOP); courses.Add(courseCsharp); courses.Add(courseAspNet); var careers = new List <Career>(); var careerDotNet = new Career("Especialista .NET", "especialista-dotnet"); var careerItem3 = new CareerItem(3, "OOP", "", courseOOP); var careerItem1 = new CareerItem(1, "Comece por aqui", "", null); var careerItem2 = new CareerItem(2, ".NET", "", courseAspNet); careerDotNet.Items.Add(careerItem2); careerDotNet.Items.Add(careerItem3); careerDotNet.Items.Add(careerItem1); careers.Add(careerDotNet); foreach (var career in careers) { foreach (var item in career.Items.OrderBy(x => x.Ordem)) { Console.WriteLine($"{item.Ordem} - {item.Title}"); Console.WriteLine(item.Course?.Title); Console.WriteLine(item.Course?.Level); foreach (var notification in item.Notifications) { Console.WriteLine($"{notification.Property} - {notification.Message}"); } } } var payPalSubscription = new PayPalSubscription(); var student = new Student(); student.CreateSubscription(payPalSubscription); }
protected void Page_Load(object sender, EventArgs e) { Career career = (Career)Session["CareerEdit"]; if (!IsPostBack) { txtName.Value = career.Name; txtDesciption.Value = career.Description; txtCode.Value = career.Code; } }
public async Task <IActionResult> Create([Bind("id,title,description,department,type,category,deadline")] Career career) { if (ModelState.IsValid) { _context.Add(career); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(career)); }
public IHttpActionResult GetCareer(int id) { Career career = db.Careers.Find(id); if (career == null) { return(NotFound()); } return(Ok(career)); }
// Realiza un Add a la lista de Carreras public void AddCareer(MainWindow mainWindow) { Career career = new Career { Id = 3, Name = "Medicina", Code = "MD" }; mainWindow.ManageCareer(career, true); }
public IActionResult Edit(Career Career) { if (ModelState.IsValid) { bool isAuthenticated = User.Identity.IsAuthenticated; return(RedirectToAction(nameof(Index))); } return(View(Career)); }
void EnterName(string name) { var player = new CharacterBuilder() .Name.Is(name) .Attributes.StrenghtIs(6) .Attributes.MaxHealthIs(10); var career = new Career(player); GameManager.Career = career; GameManager.EnterState(new Town(GameManager)); }
internal Career Edit(Career editData, string userId) { Career original = GetById(editData.Id); if (original.creatorId != userId) { throw new Exception("Access Denied: Cannot Edit a Career You did not Create"); } editData.name = editData.name == null ? original.name: editData.name; return(_repo.Edit(editData)); }
public override bool IsEligible(Career c) { Business business = OmniCareer.Career <Business>(c); if (business == null) { return(false); } return(business.OwnerDescription == business.SimConspiringPrank); }
public ActionResult Edit(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Career career = _service.GetCareerById(id); CareerViewModel viewModelList = Mapper.Map <Career, CareerViewModel>(career); return(View(viewModelList)); }
public ActionResult Create([Bind(Include = "Id,First_Name,Last_Name,Email,Phone,Desired_Position")] Career career) { if (ModelState.IsValid) { db.Careers.Add(career); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(career)); }
/// <summary> /// Trigger whatever action the PartModule has attached to this Action, given the kOS name for the action. /// Warning - it probably triggers the entire action group that is attached to this action if there is one, /// not just the action on this one part. /// <br/><br/> /// NOTE: After kOS 0.15.5, this ability is limited by career progress of the VAB/SPH. /// </summary> /// <param name="suffixName"></param> /// <param name="param">true = activate, false = de-activate</param> private void CallKSPAction(StringValue suffixName, BooleanValue param) { ThrowIfNotCPUVessel(); BaseAction act = GetAction(suffixName); if (act == null) throw new KOSLookupFailException("ACTION", suffixName, this); string careerReason; if (!Career.CanDoActions(out careerReason)) throw new KOSLowTechException("use :DOACTION", careerReason); act.Invoke(new KSPActionParam(act.actionGroup, (param ? KSPActionType.Activate : KSPActionType.Deactivate))); }
public static Career Factory(List <CareerNode> careerNodes, StatsManager stats) { Career ret = new Career(); ret.careerNodes = careerNodes; ret.root = CareerNode.Root(ret.careerNodes); ret.leaves = CareerNode.Leaves(ret.careerNodes); ret.stats = stats; ret.playerData = new ActorData(ret.stats); return(ret); }
public async Task <IActionResult> Create([Bind("CareerID,Name")] Career career) { if (ModelState.IsValid) { _context.Add(career); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(career)); }
public static InteractionInstance GetWorkInteraction(Career job) { if (job is School) { return(Singleton.CreateInstance(job.CareerLoc.Owner, job.OwnerDescription.CreatedSim, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true)); } else { return(job.CreateWorkInteractionInstance()); } }
public void GetCareerById_GetValue_ShouldReturnSomeValue() { var Career = new Career { Id = It.IsAny <int>() }; uow.Setup(x => x.Careers.Get(It.IsAny <int>())).Returns(Career); // act & assert NUnit.Framework.Assert.IsNotNull(carService.GetCareerById(It.IsAny <int>())); }
public ActionResult Edit([Bind(Include = "CareerID,AttendedCollege,Graduations,HaveJob,HadJob,Accomplishments,FirstDayOfSchool,ArmedForces,Volunteer,Legacies,TechSchool,LicensesCertifications,FirstJob,WorstJob")] Career career) { if (ModelState.IsValid) { db.Entry(career).State = EntityState.Modified; db.SaveChanges(); //you changed this next line to Details/id. Hopefully it takes you to the right screen. return(RedirectToAction("Details", new { id = career.CareerID })); } return(View(career)); }
public async Task <IActionResult> Create([Bind("Id,Description")] Career Career) { if (ModelState.IsValid) { this.databaseContext.Add(Career); await this.databaseContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(Career)); }
// Methods public bool HasPartner(Career career, out SimDescription partner) { partner = null; LawEnforcement enforcement = OmniCareer.Career <LawEnforcement> (career); if (enforcement != null) { partner = enforcement.Partner; } return(partner != null); }
public ActionResult Create([Bind(Include = "id,jobTitle,location,ShortDiscription,jobintroduction,Yourmission,Skills,BanerImage")] Career career) { if (ModelState.IsValid) { db.Career.Add(career); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(career)); }
public override float FindMetricValue(Career career) { Music music = OmniCareer.Career <Music> (career); if (music == null) { return(0); } return((float)music.ConcertsPerformed); }
public async Task Create(Career career) { var faculty = await _facultyRepository.FindById(career.FacultyId); var newCareer = new Career { Name = career.Name, Code = career.Code, Faculty = faculty }; await _careerRepository.Add(newCareer); }
public override int GetNewCareerLevel(Career oldCareer) { if (mAbsoluteLevel > 0) { return(mAbsoluteLevel); } else { int level = oldCareer.CurLevel.Level; return(RandomUtil.GetInt(level - mRelativeLevelMin, level + mRelativeLevelMax)); } }
public void TestDelete() { var repo = new CareerRepository(new MoviesContext()); var career = new Career { Id = Guid.NewGuid(), Title = "testDeleteCareer" }; repo.Insert(career); repo.Save(); repo.Delete(career.Id); repo.Save(); var sameCareer = repo.GetById(career.Id); Assert.IsNull(sameCareer); }
public override bool ShouldAddTone(Career career) { if (!base.ShouldAddTone(career)) return false; foreach (PerfMetric metric in career.CurLevel.Metrics) { if (metric is MetricConcertsPerformed) { return true; } } return false; }
public override float FindMetricValue(Career career) { Journalism journalism = OmniCareer.Career <Journalism>(career); int num = 0x0; if (journalism != null) { for (int i = 0x0; i < Journalism.kWindowForRememberingStories; i++) { num += journalism.mStoriesWrittenPastNDays[i]; } num += journalism.StoriesWrittenToday; } return (float)num; }
public override float FindMetricValue(Career career) { Education education = OmniCareer.Career<Education>(career); int num = 0x0; if (education != null) { for (int i = 0x0; i < Education.kWindowForRememberingLectures; i++) { num += education.mLecturesInLastNDays[i]; } num += education.LecturesGivenToday; } return (float)num; }
public override void RunEvent(Career c) { ObjectGuid simObjectId = new ObjectGuid(); if (c.OwnerDescription.CreatedSim != null) { simObjectId = c.OwnerDescription.CreatedSim.ObjectId; } base.Display(LocalizeString(c.OwnerDescription, "ImpromptuMeetingEvent", new object[] { c.OwnerDescription }), simObjectId, c); Business business = OmniCareer.Career<Business>(c); if (business != null) { business.MeetingsHeldToday++; } }
public override float FindMetricValue(Career career) { int highestLevel = 0; foreach (SkillNames skill in sSkills) { int level = career.OwnerDescription.SkillManager.GetSkillLevel(skill); if (highestLevel < level) { highestLevel = level; } } return highestLevel; }
public void TestUpdate() { var repo = new CareerRepository(new MoviesContext()); var career = new Career { Id = Guid.NewGuid(), Title = "testUpdateCareer" }; repo.Insert(career); repo.Save(); career.Title = "UpdatedCareer"; repo.Update(career); repo.Save(); var sameCareer = repo.GetById(career.Id); Assert.AreEqual(career.Title, sameCareer.Title); repo.Delete(career); repo.Save(); }
public static InteractionInstance GetWorkInteraction(Career job) { InteractionInstance instance = null; try { if (OnWorkInteraction != null) { instance = OnWorkInteraction(job); } else { instance = job.CreateWorkInteractionInstance(); } } catch (Exception e) { StoryProgression.DebugException(job.OwnerDescription, e); } return instance; }
public override string MetricTitle(Career career) { return Common.Localize("MusicSkill:Title", career.IsOwnerFemale); }
public override int GetNewCareerLevel(Career oldCareer) { if (mAbsoluteLevel > 0) { return mAbsoluteLevel; } else { int level = oldCareer.CurLevel.Level; return RandomUtil.GetInt(level - mRelativeLevelMin, level + mRelativeLevelMax); } }
protected static void LoadCareerEvents(Career career, BooterHelper.BootFile eventsFile, XmlDbTable eventDataTable) { if (eventDataTable == null) return; BooterLogger.AddTrace(eventsFile + ": Found " + career.Name + " Events = " + eventDataTable.Rows.Count); foreach (XmlDbRow row in eventDataTable.Rows) { ProductVersion version; row.TryGetEnum<ProductVersion>("ProductVersion", out version, ProductVersion.BaseGame); if (GameUtils.IsInstalled(version)) { string str3 = row.GetString("EventName"); string str4 = row.GetString("OpportunityName"); bool flag = row.GetInt("SureShotEvent") == 1; Type classType; if ((str4 != string.Empty) && (str3 == string.Empty)) { classType = typeof(Career.EventOpportunity); } else { classType = row.GetClassType("EventName"); } Type[] types = new Type[] { typeof(XmlDbRow), typeof(Dictionary<string, Dictionary<int, CareerLevel>>), typeof(string) }; object obj = null; try { obj = classType.GetConstructor(types).Invoke(new object[] { row, career.SharedData.CareerLevels, eventDataTable.Name }); } catch(Exception e) { BooterLogger.AddError(eventsFile + ": Constructor Fail " + row.GetString("EventName")); Common.Exception(eventsFile + ": Constructor Fail " + row.GetString("EventName"), e); } if (obj == null) { BooterLogger.AddError(eventsFile + ": Bad Class " + row.GetString("EventName")); } else { Career.EventOpportunity opportunityEvent = obj as Career.EventOpportunity; // new Code if ((opportunityEvent != null) && (opportunityEvent.mOpportunity == OpportunityNames.Undefined)) { opportunityEvent.mOpportunity = unchecked((OpportunityNames)ResourceUtils.HashString64(str4)); } Career.EventDaily dailyEvent = obj as Career.EventDaily; if (dailyEvent != null) { if (dailyEvent.AvailableLevels(career).Count == 0) { BooterLogger.AddError(eventsFile + ": No AvailableLevels " + row.GetString("EventType")); } else { // new Code if (dailyEvent.mEventType == Career.CareerEventType.None) { dailyEvent.mEventType = unchecked((Career.CareerEventType)ResourceUtils.HashString64(row.GetString("EventType"))); } if (career.SharedData == null) { BooterLogger.AddError(eventsFile + ": Career SharedData missing " + career.mCareerGuid); } else { if (flag) { career.SharedData.SureShotEvent = dailyEvent; } else { career.SharedData.CareerEventList.Add(dailyEvent); try { CareerEventManager.sAllEvents.Add(dailyEvent.EventType, dailyEvent); } catch { BooterLogger.AddError(eventsFile + ": Duplicate Event " + row.GetString("EventType")); } } } } } else { BooterLogger.AddError(eventsFile + ": Not EventDaily " + row.GetString("EventType")); } } } } }
public override void RunEvent(Career c) { Career newCareer = NewCareer as Career; if (newCareer == null) return; int newCareerLevel = this.GetNewCareerLevel(c); CareerLevel level = null; foreach (Dictionary<int, CareerLevel> dictionary in newCareer.CareerLevels.Values) { if (dictionary.TryGetValue(newCareerLevel, out level)) { ObjectGuid simObjectId = new ObjectGuid(); if (c.OwnerDescription.CreatedSim != null) { simObjectId = c.OwnerDescription.CreatedSim.ObjectId; } if (Display(LocalizeString(c.OwnerDescription.IsFemale, mStringKey, new object[] { c.OwnerDescription, level.GetLocalizedName(c.OwnerDescription), level.Level, c.CurLevel.GetLocalizedName(c.OwnerDescription), c.CareerLevel }), simObjectId, c.OwnerDescription.IsFemale, c)) { DoTransfer(c, newCareerLevel); } break; } } }
public override bool IsEligible(Career c) { if (NewCareer == null) return false; return base.IsEligible(c); }
protected static bool UpdateCareer(Career career, CareerLocation location) { if (location.Career == null) return false; if (location.Career.Guid != career.Guid) return false; career.CareerLoc = location; if (!location.Workers.Contains(career.OwnerDescription)) { location.Workers.Add(career.OwnerDescription); } return true; }
public override string MetricTitle(Career career) { return OmniCareer.LocalizeString(career.OwnerDescription, "TitleWinLossRecord", "Gameplay/Careers/Metrics:TitleWinLossRecord", new object[0]); }
public override string MetricDescription(Career career) { return Common.Localize("MusicSkill:Description", career.IsOwnerFemale); }