forked from the-csharp-academy/CodeReviews.Console.MathGame
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMathQuizApp.cs
More file actions
35 lines (32 loc) · 885 Bytes
/
Copy pathMathQuizApp.cs
File metadata and controls
35 lines (32 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
public class MathQuizApp
{
public UserGameInteract _interact;
public HandleUserChoice _choiceHandler;
public MathQuizApp(UserGameInteract interact, HandleUserChoice choiceHandler)
{
_interact = interact;
_choiceHandler = choiceHandler;
}
public void Run()
{
Operation chosenOp;
bool endApp = false;
while (!endApp)
{
Menu m = _interact.PromptMenu();
switch (m)
{
case Menu.History:
Console.WriteLine("no");
break;
case Menu.Play:
chosenOp = _interact.PromptOperation();
_choiceHandler.initGame(chosenOp);
break;
case Menu.Exit:
endApp = true;
break;
}
}
}
}