Working with events

This commit is contained in:
Jonas Zeunert
2020-02-03 23:44:25 +01:00
parent 3776724322
commit c5a250d040
10 changed files with 72 additions and 9 deletions

17
src/GameFactory.py Normal file
View File

@@ -0,0 +1,17 @@
from src.targets import *
from src.EventHandler import EventHandler
class GameFactory:
def createGame(self):
targets = self.createAllTargets()
eventHandler = EventHandler(targets)
pass
def createAllTargets(self):
result = dict
glo = globals() # Save globals so the dict does not change during execution of the script
for key in glo:
target = glo[key]
if(key.endswith('Target') and type(target) == 'class'):
result[key] = target()
return result