import asyncio
from src.networking.Networking import Networking


class EventHandler:
    def __init__(self, targets):
        self.isRunning = True
        self.targets = targets

    async def handleEvents(self):
        self.isRunning = True
        while(self.isRunning):
            event = Networking.getInputEvent()
            self.targets[event].hit()

    def stop(self):
        self.isRunning = False
