output_server_address = ''
input_server_address = ''

#network = Networking(output_server_address, input_server_address)
network = ''

class EventHandler():
    def __init__(self, network):
        # brace yourselves, python incoming
        self.subclasses = {subcls.__name__: subcls for subcls in self.__class__.__subclasses__()}
        self.network = network

    def handle(self, name):
        self.subclasses[name](network)

class LeftFlapEventHandler(EventHandler):
    def __init__(self, network):
        print('Left Flap Event gets handled')
        self.handle()

    def handle(self):
        # do stuff...
        pass

class GameState:
    def __init__(self, targets):
        self.score = 0
        self.targets = targets
        for target in self.targets:
            target.on(target.hit_key, self.__target_hit__)
    
    def __target_hit__(self, target):
        pass

def snake_to_camel(word):
    return ''.join(x.capitalize() or '' for x in word.split('_'))

handler = EventHandler(network)
handler.handle(snake_to_camel('left_flap') + 'EventHandler')

# while True:
#     event_name = snake_to_camel(network.getInputEvent())
#     handler.handle(event_name + 'EventHandler')



