-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserInterface.py
More file actions
88 lines (78 loc) · 2.42 KB
/
userInterface.py
File metadata and controls
88 lines (78 loc) · 2.42 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
from prompt.prompt import Prompt
from player.player import Player
from world.timeService import TimeService
# @author Daniel McCoy Stephenson
class UserInterface:
def __init__(self, currentPrompt: Prompt, timeService: TimeService, player: Player):
self.currentPrompt = currentPrompt
self.timeService = timeService
self.player = player
self.prompt = "Make your choice!"
self.optionList = []
self.times = {
0: "12:00 AM",
1: "1:00 AM",
2: "2:00 AM",
3: "3:00 AM",
4: "4:00 AM",
5: "5:00 AM",
6: "6:00 AM",
7: "7:00 AM",
8: "8:00 AM",
9: "9:00 AM",
10: "10:00 AM",
11: "11:00 AM",
12: "12:00 PM",
13: "1:00 PM",
14: "2:00 PM",
15: "3:00 PM",
16: "4:00 PM",
17: "5:00 PM",
18: "6:00 PM",
19: "7:00 PM",
20: "8:00 PM",
21: "9:00 PM",
22: "10:00 PM",
23: "11:00 PM",
}
def lotsOfSpace(self):
print("\n" * 20)
def divider(self):
print("\n")
print("-" * 75)
print("\n")
def showOptions(
self,
descriptor,
optionList,
):
while True:
self.lotsOfSpace()
self.divider()
print(" " + descriptor)
self.divider()
print(" Day %d" % self.timeService.day)
print(" | " + self.times[self.timeService.time])
print(" | Money: $%d" % self.player.money)
print(" | Fish: %d" % self.player.fishCount)
print(" | Energy: %d" % self.player.energy)
print("\n " + self.currentPrompt.text)
self.divider()
self.n = 1
self.listOfN = []
for option in optionList:
print(" [%d] %s" % (self.n, option))
self.listOfN.append("%d" % self.n)
self.n += 1
choice = input("\n> ")
for i in self.listOfN:
if choice == i:
return choice
self.currentPrompt.text = "Try again!"
def showDialogue(self, text):
self.lotsOfSpace()
self.divider()
print(text)
self.divider()
input(" [ CONTINUE ]")
self.currentPrompt.text = "What would you like to do?"