Ejemplo n.º 1
0
    private void FinishLearning()
    {
        LearnedWord learned = new LearnedWord(progressedWord.WordIng, progressedWord.WordTr, progressedWord.WordType, progressedWord.Sentence, DateTime.Now);

        Db_Learning.DeleteWord(progressedWord);
        Db_Learned.SetWord(learned);
    }
Ejemplo n.º 2
0
    public void StartLearning()
    {
        level = 1;
        Date  = DateTime.Now.AddDays(1);

        Db_Learning.UpdateWord(progressedWord);
    }
Ejemplo n.º 3
0
    private void Start()
    {
        List <Word> askableWord = new List <Word>();

        foreach (Word w in Db_Learning.GetAllWords())
        {
            if (DateTime.Now > w.wordProgress.Date)
            {
                askableWord.Add(w);
            }
        }

        if (askableWord.Count > 0)
        {
            AskQuestion(askableWord);
        }
    }
Ejemplo n.º 4
0
    public void NextLevel()
    {
        level++;

        switch (level)
        {
        case 2: Date = DateTime.Now.AddMonths(1); break;

        case 3: Date = DateTime.Now.AddMonths(6); break;

        case 4: Date = DateTime.Now.AddYears(1); break;

        case 5: FinishLearning(); return;
        }

        Db_Learning.UpdateWord(progressedWord);
    }
Ejemplo n.º 5
0
    public void Button_AddWord()
    {
        if (wordIng.text == "" || wordTr.text == "")
        {
            PopUp("Zorunlu yerleri doldurun");
        }
        else
        {
            Word word = new Word(wordIng.text, wordTr.text, wordType.options[wordType.value].text, sentence.text);
            word.wordProgress.StartLearning();

            Db_Learning.SetWord(word);
            PopUp("Kayıt Başarılı");

            ResetTextbox();
        }
    }
Ejemplo n.º 6
0
    void GetAllLearningWords()
    {
        List <Word> words = Db_Learning.GetAllWords();

        foreach (Word word in words)
        {
            GameObject wordObj = new GameObject();
            wordObj.transform.localScale = new Vector3(1, 1, 1);
            wordObj.transform.parent     = panel.transform;
            wordObj.AddComponent <Text>();

            Text text = wordObj.GetComponent <Text>();
            text.text                 = word.WordIng + " - " + word.WordTr;
            text.font                 = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
            text.fontSize             = 32;
            text.alignment            = TextAnchor.MiddleCenter;
            text.color                = Color.black;
            text.transform.localScale = new Vector3(1, 1, 1);
        }
    }