コード例 #1
0
    public string GetShout_Succes(ShoutType st)
    {
        switch (st)
        {
        case ShoutType.WinTitle:
        {
            return(GetRandomElementFromListAndShuffle(winTitle));
        }

        case ShoutType.WinContent:
        {
            return(GetRandomElementFromListAndShuffle(winContent));
        }

        case ShoutType.FailTitle:
        {
            return(GetRandomElementFromListAndShuffle(failTitle));
        }

        case ShoutType.FailContent:
        {
            return(GetRandomElementFromListAndShuffle(failContent));
        }
        }

        return("");
    }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name")] ShoutType shoutType)
        {
            if (id != shoutType.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(shoutType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShoutTypeExists(shoutType.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(shoutType));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("ID,Name")] ShoutType shoutType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shoutType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(shoutType));
        }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        //poll for input to initialize shout
        if (!shoutStarted)
        {
            //start shout when either click is pressed, give it according type
            if (Input.GetMouseButtonDown(0) && !hpRef.dead) //left
            {
                shoutStarted = true;
                isTrashTalk  = false;

                introText.SetActive(false);
                leftText.SetActive(true);
                rightText.SetActive(false);
            }
            else if (Input.GetMouseButtonDown(1) && !hpRef.dead) //right
            {
                shoutStarted = true;
                isTrashTalk  = true;

                introText.SetActive(false);
                leftText.SetActive(false);
                rightText.SetActive(true);
            }
        }
        else
        {
            if (Input.GetMouseButtonDown(0)) //left
            {
                //change type
                if (isTrashTalk == true)
                {
                    type = ShoutType.TRASHTALK_DORK;
                    scorekeeper.SendMessage("incrementScoreLocal", 1000);
                }
                else
                {
                    type = ShoutType.SHIELD_RED;
                    myColor.setColor((int)type);
                    objManager.SendMessage("SwitchColor", (int)type);
                }

                Debug.Log(type);

                //send data with corresponding type, reset shout data, do this later
                resetShout();
            }
            else if (Input.GetMouseButtonDown(1)) //right
            {
                if (isTrashTalk == true)
                {
                    type = ShoutType.TRASHTALK_SHORTS;
                    scorekeeper.SendMessage("incrementScoreLocal", 500);
                }
                else
                {
                    type = ShoutType.SHIELD_BLUE;
                    myColor.setColor((int)type);
                    objManager.SendMessage("SwitchColor", (int)type);
                }
                Debug.Log(type);

                //send data with corresponding type, reset shout data, do this later
                resetShout();
            }
            else if (Input.GetMouseButtonDown(2)) //middle
            {
                if (isTrashTalk == true)
                {
                    type = ShoutType.TRASHTALK_DAD;
                    scorekeeper.SendMessage("incrementScoreLocal", 2000);
                }
                else
                {
                    type = ShoutType.SHIELD_YELLOW;
                    myColor.setColor((int)type);
                    objManager.SendMessage("SwitchColor", (int)type);
                }

                Debug.Log(type);

                //send data with corresponding type, reset shout data, do this later
                resetShout();
            }
        }
    }