public void SwitchState(eState newState) { switch (newState) { case eState.Normal: StateTimer.Enabled = false; if (State == eState.GoodChoice) { if (ThisAnswerIsStillCorrect || Modus == eModus.OneChance) { AvailableLetters.RemoveAt(AvailableLetters.Count - 1); if (AvailableLetters.Count == 0) { ShowScores(); } } else { ActiveLetter.ResetChoices(); AvailableLetters.Shuffle(); } ThisAnswerIsStillCorrect = true; } break; case eState.WrongChoice: StateTimer.Stop(); StateTimer.Start(); StateTimer.Enabled = true; break; case eState.GoodChoice: StateTimer.Stop(); StateTimer.Start(); StateTimer.Enabled = true; break; default: throw new ArgumentOutOfRangeException("newState"); } State = newState; }
public void Chose(eChoice4 choice) { Choice chosenChoice = ActiveLetter.Choices[(int)choice]; if (!chosenChoice.HasBeenChosen) { if (chosenChoice.IsCorrect) { ActiveLetter.HideWrongChoices(); NextLetter(); SwitchState(eState.GoodChoice); } else { ThisAnswerIsStillCorrect = false; chosenChoice.HasBeenChosen = true; SwitchState(eState.WrongChoice); } frmMain.Instance.Render(); } }
public void Render(Graphics g) { ActiveLetter.Render(g); }