bla
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user