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));
        }
Esempio n. 4
0
 // 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;
     }
 }
Esempio n. 5
0
        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 }));
        }
Esempio n. 8
0
    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);
        }
    }
Esempio n. 9
0
    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();
        }
    }
Esempio n. 10
0
        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);
            }
        }
Esempio n. 11
0
 // 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;
         }
     }
 }
Esempio n. 12
0
    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);
    }
Esempio n. 13
0
    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;
    }
Esempio n. 14
0
 public SceneChoise(Scene _scene, Choise _choise, int num)
 {
     Choise      = _choise;
     Scene       = _scene;
     SceneNumber = num;
 }
Esempio n. 15
0
 public void TriggerDialog(Choise choise)
 {
     DialogMan.Trigger(choise);
 }
Esempio n. 16
0
 public void Option1()
 {
     choiceInStory = Choise.Option1;
 }
Esempio n. 17
0
 public void Option2()
 {
     choiceInStory = Choise.Option2;
 }
Esempio n. 18
0
 public void Option3()
 {
     choiceInStory = Choise.Option3;
 }
Esempio n. 19
0
 // Start is called before the first frame update
 void Start()
 {
     MadeChoise = Choise.None;
 }
 public ChoiseNotFoundException(string message, Choise choise)
     : base(message)
 {
 }