Exemple #1
0
    public void AddCategoryScore(CategoryChoice currentChoice)
    {
        int difference = categoryDatabase.categoryDictionary[leftID] - categoryDatabase.categoryDictionary[rightID];
        int dif        = Mathf.Abs(difference);

        switch (currentChoice)
        {
        case CategoryChoice.Left:
            if (difference > 0)
            {
                categoryDatabase.categoryDictionary[leftID] += 1;
            }
            else if (difference == 0)
            {
                categoryDatabase.categoryDictionary[leftID] += 1;
            }
            else if (difference < 0)
            {
                categoryDatabase.categoryDictionary[leftID] += dif + 1;
            }
            break;

        case CategoryChoice.Right:
            if (difference > 0)
            {
                categoryDatabase.categoryDictionary[rightID] += dif + 1;
            }
            else if (difference == 0)
            {
                categoryDatabase.categoryDictionary[rightID] += 1;
            }
            else if (difference < 0)
            {
                categoryDatabase.categoryDictionary[rightID] += 1;
            }
            break;

        case CategoryChoice.Neither:
            break;
        }
    }
 public void SaveCatChoice(CategoryChoice choice)
 {
     _session.Set(CHOICEKEY, choice);
 }
Exemple #3
0
 public void GetChoiceButton(CategoryChoice choice)
 {
     currentChoice = choice;
 }
Exemple #4
0
 void ResetProperty()
 {
     leftID        = "";
     rightID       = "";
     currentChoice = CategoryChoice.No;
 }
        //public Category AddCategory(Category e)
        //{

        //    return db.Categories.Add(e);

        //}

        public CategoryChoice AddCategoryChoice(CategoryChoice e)
        {
            return(db.CategoryChoices.Add(e));
        }