15 lines
597 B
Python
15 lines
597 B
Python
from displays.PlayerDisplay import PlayerDisplay
|
|
from displays.SpecialDisplay import SpecialDisplay
|
|
|
|
class DisplayFactory:
|
|
def __init__(self, displayNames):
|
|
self.displayNames = displayNames
|
|
|
|
def createSpecialDisplay(self):
|
|
name = next(displayName.name for displayName in self.displayNames if "Special" in displayName.name)
|
|
return SpecialDisplay(name)
|
|
|
|
def createPlayerDisplay(self, id):
|
|
name = next(displayName.name for displayName in self.displayNames if "Player" in displayName.name and str(id) in displayName.name)
|
|
return PlayerDisplay(name)
|