public CodeGenerator.DifficultyType GetRandomDifficulty()
 {
     CodeGenerator.DifficultyType[] values =
         (CodeGenerator.DifficultyType[])Enum.GetValues(typeof(CodeGenerator.DifficultyType));
     CodeGenerator.DifficultyType random =
         (CodeGenerator.DifficultyType)values.GetValue(Random.Range(0, values.Length));
     return(random);
 }
    protected void SendWrongEvent(string code, CodeGenerator.DifficultyType difficulty)
    {
        this.HandleCallback(code);

        if (WrongEvent != null)
        {
            WrongEvent(code, difficulty);
        }
    }
Beispiel #3
0
    private void OnCorrectCodeEntred(string s, CodeGenerator.DifficultyType difficulty)
    {
        if (s.Equals("sudo make me a sandwich"))
        {
            RefillTimeHealth();
            return;
        }

        float amount = AddTimeOnCorrectCode * ((int)difficulty + 1);

        Debug.Log(amount);
        AddTimeHealth(amount);
    }
    protected void SendCorrectEvent(string code, CodeGenerator.DifficultyType difficulty)
    {
        Func <string, bool> reference = null;

        this._codeMapping.TryGetValue(code, out reference);
        if (reference != null)
        {
            reference(code);
        }

        if (CorrectEvent != null)
        {
            CorrectEvent(code, difficulty);
        }
    }