This commit is contained in:
Jonas Zeunert
2022-08-30 18:09:42 +02:00
parent 808c9bbd28
commit f6c1fcc1f7
4 changed files with 15 additions and 6 deletions

View File

@@ -1,10 +1,18 @@
from displays.PlayerDisplay import PlayerDisplay
from displays.SpecialDisplay import SpecialDisplay
import config
class DisplayFactory:
def __init__(self, displayNames):
self.displayNames = displayNames
def createDisplays(self):
displays = [None] * config.MAX_PLAYERS
for displayName in self.displayNames:
if "Player" in displayName:
id = displayName.replace("Player", "")
displays[id] = PlayerDisplay(displayName)
return displays
def createSpecialDisplay(self):
name = next(displayName['name'] for displayName in self.displayNames if "Special" in displayName['name'])
return SpecialDisplay(name)