示例#1
0
        private void PreEvalutate()
        {
            _values.Clear();

            _typeMode = TypeMode.Auto;
            _typeMode = ValueButton.Checked ? TypeMode.Value : _typeMode;
            _typeMode = ClassButton.Checked ? TypeMode.Class : _typeMode;
            _typeMode = ListButton.Checked ? TypeMode.List : _typeMode;
            _typeMode = TupleButton.Checked ? TypeMode.Tuple : _typeMode;
            _typeMode = DictionaryButton.Checked ? TypeMode.Dictionary : _typeMode;

            _evaluate = EvaluateBox.Text;

            var found = false;

            foreach (var item in EvaluateBox.Items)
            {
                if (item as string == _evaluate)
                {
                    found = true;
                }
            }

            if (!found)
            {
                EvaluateBox.Items.Insert(0, EvaluateBox.Text);
            }

            _done = false;
        }
示例#2
0
 private void ResetCharacter()
 {
     Time.timeScale = 1;
     countdown.gameObject.SetActive(false);
     wordToTypeComponent.gameObject.SetActive(false);
     mode = TypeMode.Run;
     character.GetComponent <CharacterAnimation>().SetWalk(true);
 }
    public static string  stringFromMode(TypeMode the_enum)
    {
        switch (the_enum)
        {
        case TypeMode.Mode_AgeCalculatorStart:
            return("AgeCalculatorStart");

        default:
            Debug.Assert(false);
            return(null);
        }
    }
    public static string  stringFromMode(TypeMode the_enum)
    {
        switch (the_enum)
        {
        case TypeMode.Mode_CarControlLights:
            return("CarControlLights");

        default:
            Debug.Assert(false);
            return(null);
        }
    }
示例#5
0
    public void QuickfireSingle()
    {
        mode = TypeMode.Quickfire;

        currentWord = lines[UnityEngine.Random.Range(0, lines.Count - 1)];
        currentWord = currentWord.ToUpper();
        currentWord = currentWord.Substring(0, currentWord.Length - 1);

        countdown.gameObject.SetActive(true);
        wordToTypeComponent.gameObject.SetActive(true);
        wordToTypeComponent.text = "Type:" + '\n' + currentWord;

        StartCoroutine(InitiateCountdown());
    }
示例#6
0
    private IEnumerator EndingSequence()
    {
        countdownTimer = Globals.quickfireEndTime;
        while (countdownTimer > 0)
        {
            var countdownDisplay = (float)Math.Ceiling((decimal)countdownTimer);
            countdown.text  = countdownDisplay.ToString();
            countdownTimer -= Time.unscaledDeltaTime;

            yield return(null);
        }

        mode = TypeMode.Done;

        character.GetComponent <AudioSource>().PlayOneShot(character.GetComponent <CharacterController>().wrong);
        StartCoroutine(character.GetComponent <PlayerLives>().InitiateGameOver());
    }
示例#7
0
 public ActionResult Modify(TypeMode m)
 {
     try
     {
         bool check = DataAdminController.CheckUser(Session, m);
         if (check)
         {
             return(Json(m));
         }
         DBHelper.Update(MODIFY, m.Tname, m.Tinfo, m.IsEnable, m.Tid);
         m.Success = true;
     }
     catch (Exception ex)
     {
         m.Fail(ex);
     }
     return(Json(m));
 }
示例#8
0
 public ActionResult Index(TypeMode m)
 {
     try
     {
         bool check = DataAdminController.CheckUser(Session, m);
         if (check)
         {
             return(Json(m));
         }
         m.TypeList = DBHelper.QueryDicRows(QUERY);
         m.Success  = true;
     }
     catch (Exception ex)
     {
         m.Fail(ex);
     }
     return(Json(m));
 }
示例#9
0
    public void QuickfireEnd()
    {
        mode = TypeMode.QuickfireEnd;

        wordsToType   = new List <string>();
        wordsRevealed = new List <string>();
        for (int i = 0; i < 10; i++)
        {
            wordsToType.Add(lines[UnityEngine.Random.Range(0, lines.Count - 1)]);
            wordsRevealed.Add("?");
        }


        GetCurrentWordEndSequence();

        wordIterator++;

        wordList.gameObject.SetActive(true);
        countdown.gameObject.SetActive(true);
        wordToTypeComponent.gameObject.SetActive(true);


        StartCoroutine(EndingSequence());
    }
 public void setMode(TypeMode new_value)
 {
     setMode();
 }
 protected override void handle_result(TypeMode result)
 {
     top.value.Add(result);
 }
            protected override void handle_result(TypeMode result)
            {
//@@@        Debug.Assert(!have_value);
                have_value = true;
                value      = result;
            }
 protected abstract void handle_result(TypeMode result);
示例#14
0
        private void PreEvalutate()
        {
            _values.Clear();

            _typeMode = TypeMode.Auto;
            _typeMode = ValueButton.Checked ? TypeMode.Value : _typeMode;
            _typeMode = ClassButton.Checked ? TypeMode.Class : _typeMode;
            _typeMode = ListButton.Checked ? TypeMode.List : _typeMode;
            _typeMode = TupleButton.Checked ? TypeMode.Tuple : _typeMode;
            _typeMode = DictionaryButton.Checked ? TypeMode.Dictionary : _typeMode;

            _evaluate = EvaluateBox.Text;

            var found = false;
            foreach (var item in EvaluateBox.Items)
            {
                if (item as string == _evaluate)
                    found = true;
            }

            if (!found)
                EvaluateBox.Items.Insert(0, EvaluateBox.Text);

            _done = false;
        }