-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtetrisgame.py
23 lines (19 loc) · 886 Bytes
/
tetrisgame.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from gametype import GameType
from outputmanager import IngoAppOutputManager, LumptyOutputManager, JstrisOutputManager
from piecepicker import GameColorPiecePicker
from scoringcalculator import IngoScoringCalculator
class TetrisGame():
def __init__(self, gameType=None):
self.__gameType = gameType
self.outputManager = None
self.piecePicker = None
self.scoringCalculator = None
if gameType != None:
if gameType == GameType.INGO:
self.outputManager = IngoAppOutputManager()
self.scoringCalculator = IngoScoringCalculator()
elif gameType == GameType.LUMPTY:
self.outputManager = LumptyOutputManager()
elif gameType == GameType.JSTRIS:
self.outputManager = JstrisOutputManager()
self.piecePicker = GameColorPiecePicker(gameType)