Add player choosing

This commit is contained in:
rhetenor
2022-08-30 17:06:25 +02:00
parent 269e072010
commit 4c3aa016ba
6 changed files with 71 additions and 31 deletions

View File

@@ -3,11 +3,14 @@ from PlayerState import PlayerState
from displays.DummyDisplay import DummyDisplay
class PlayerStateFactory:
def __init__(self, specialDisplay):
def __init__(self, specialDisplay, banks, displayFactory):
self.specialDisplay = specialDisplay
self.banks = banks
self.displayFactory = displayFactory
def createPlayerState(self, display, id, banks):
return PlayerState(display, self.specialDisplay, id, BALLS_PER_GAME, banks)
def createPlayerState(self, id):
display = self.displayFactory.createPlayerDisplay(id)
return PlayerState(display, self.specialDisplay, id, BALLS_PER_GAME, self.banks)
def createDummyPlayerState(self):
display = DummyDisplay()