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); }
public void GetChoiceButton(CategoryChoice choice) { currentChoice = choice; }
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)); }