-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.py
36 lines (28 loc) · 951 Bytes
/
display.py
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
from asciiRender import ASCIIRender
class Display:
def __init__(self, config):
self.config = config
if config.is_console_mode:
self.ASCIIRender = ASCIIRender(config)
else:
pass
def run(self):
if self.config.is_console_mode:
self.ASCIIRender.run()
def update_grid(self, grid):
if self.config.is_console_mode:
self.ASCIIRender.update_grid(grid)
def update_score(self, score):
if self.config.is_console_mode:
self.ASCIIRender.update_score(score)
def set_game_ended(self, has_ended):
if self.config.is_console_mode:
self.ASCIIRender.setGameEnded(has_ended)
def get_input_key(self):
if self.config.is_console_mode:
return self.ASCIIRender.input_key
def quit(self):
if self.config.is_console_mode:
self.ASCIIRender.quit()
else:
pass