public async Task<Choise> CreateAsync(Choise choise) { var entity = await _context.Choises.AddAsync(choise); _context.SaveChanges(); return entity.Entity; }
public async Task<Choise> UpdateAsync(Choise choise) { var entity = await _context.Choises.FindAsync(choise.Id); _context.Choises.Update(choise); _context.SaveChanges(); return entity; }
public async Task <IActionResult> Create(int id) { var preg = _questionRepository.GetQuestion(id); var resp = new Choise { QuestionId = preg.Id }; return(View(resp)); }
// Called when user makes a selection in the menu. // This is your main exit point to the rest of your Add-in public void EA_MenuClick(Repository repository, string location, string menuName, string itemName) { switch (itemName) { case "compare this package": var frm = new Choise(repository); frm.ShowDialog(); break; } }
protected void ReceiveAnswer(Choise choise) { if (!this.isWaiting) { return; } this.isWaiting = false; this.choise = choise; StartCoroutine(this.CloseWindow()); }
public async Task <Choise> CreateAsync(Choise choise) { var entity = await _choiseRepository.CreateAsync(choise); if (entity == null) { throw new ChoiseNotCreatedException(); } return(entity); }
public async Task <IActionResult> Create(Choise rpt) { if (!ModelState.IsValid) { return(View()); } rpt.Id = 0; await _repository.CreateAsync(rpt); return(RedirectToAction("Detail", "Questions", new { id = rpt.QuestionId })); }
public void GenerateEvent(Choise choise) { Debug.Log(choise); CalculateIfSurvived(choise); if (Playthrough.Count == 3) { Player.GetComponent <SpriteRenderer>().sprite = step2; } else if (Playthrough.Count == 6) { Player.GetComponent <SpriteRenderer>().sprite = step3; } else if (Playthrough.Count == 9) { Player.GetComponent <SpriteRenderer>().sprite = step4; } GameObject.FindGameObjectWithTag("Fire").GetComponent <ParticleSystem>().Stop(); if (Playthrough.Count > SaveLoad.CurrentSave.progress) { SaveLoad.CurrentSave.DemonName = Demon.Name1; SaveLoad.CurrentSave.progress = Playthrough.Count; } Destroy(CurrentEvent); int newEventId = Random.Range(0, EventList.Count - 1); while (newEventId == lasteventid) { newEventId = Random.Range(0, EventList.Count - 1); } GameObject NewEvent = (GameObject)Instantiate(EventList[newEventId]); NewEvent.name = NewEvent.GetComponent <Event>().Name + Playthrough.Count; NewEvent.transform.SetParent(EventSpawn.transform, false); NewEvent.GetComponent <Event>().SetDemon(Demon, Playthrough.Count); CurrentEvent = NewEvent; Playthrough.Add(NewEvent); DialogMan = NewEvent.GetComponentInChildren <DialogueManager>(); if (Playthrough.Count == 1) { DialogMan.TriggerStartSpeach(Choise.player); } else { DialogMan.Trigger(Choise.player); } }
public void CalculateIfSurvived(Choise choise) { if ((choise == Choise.SacrificeHuman && Demon.SecondTrait1 == Demon.Trait.Lust) || (choise == Choise.SacrificeHuman && Demon.MainTrait1 == Demon.Trait.Lust)) { Life -= 1; } if (Life <= 0) { Die(); } }
private static void CheckData(ref string enteredData, Choise condition, string retryMessage, string conditionMessage) { Console.WriteLine(conditionMessage); while (true) { enteredData = Console.ReadLine(); if (ChangeCondition(condition, enteredData)) { break; } Console.WriteLine(retryMessage); } }
// Update is called once per frame void Update() { if (!ChoiseTimer.GetComponent <TimerProgress>().hasTime&& active) { ChoiseOne.GetComponent <Button>().interactable = false; ChoiseTwo.GetComponent <Button>().interactable = false; ChoiseThree.GetComponent <Button>().interactable = false; if (MadeChoise == Choise.None) { MadeChoise = Choise.Waited; Debug.Log(this.name + MadeChoise); decided = true; } } }
private void Start() { warBaseChoise = Choise.GetWarBase(); portChoise = Choise.GetPort(); govChoise = Choise.GetGov(); cityChoise = Choise.GetCity(); state = new State() { Peoples = 10, Ammunition = 10, Money = 10, WinPoints = 0 }; SetMode(mode); }
public void makechoise(int choise) { switch (choise) { case 1: MadeChoise = Choise.First; break; case 2: MadeChoise = Choise.Second; break; case 3: MadeChoise = Choise.Third; break; } Debug.Log(this.name + MadeChoise); ChoiseTimer.GetComponent <TimerProgress>().hasTime = false; decided = true; }
public SceneChoise(Scene _scene, Choise _choise, int num) { Choise = _choise; Scene = _scene; SceneNumber = num; }
public void TriggerDialog(Choise choise) { DialogMan.Trigger(choise); }
public void Option1() { choiceInStory = Choise.Option1; }
public void Option2() { choiceInStory = Choise.Option2; }
public void Option3() { choiceInStory = Choise.Option3; }
// Start is called before the first frame update void Start() { MadeChoise = Choise.None; }
public ChoiseNotFoundException(string message, Choise choise) : base(message) { }