# Path: foos/config.py

# 
# Path: foos/ui/ui.py
# def registerMenu(f):
#     menuGenerators.append(f)


from threading import Thread
from foos import config
from foos.ui.ui import registerMenu
import time
import logging
        else:
            self.game_end_time = None
            self.timeout_close_time = None

        self.sudden_death = False

    def notifyWinner(self, t, due_to_timeout=False):
        d = {'team': t, 'due_to_timeout': due_to_timeout}
        d.update(self.current_score)
        self.bus.notify('win_game', d)
        self.bus.notify('reset_score', d)

    def check_win(self):
        if self.game_win_score:
            for t in ['yellow', 'black']:
                if self.current_score.get(t, 0) >= self.game_win_score:
                    self.notifyWinner(t)

    def check_party_win(self, due_to_timeout=False):
        ys = self.current_score['yellow']
        yb = self.current_score['black']
        if ys > yb:
            self.notifyWinner('yellow', due_to_timeout)
        elif yb > ys:
            self.notifyWinner('black', due_to_timeout)
        else:
            logger.info("Timeout - No one wins yet. Sudden death activated")
            self.sudden_death = True
            self.bus.notify("sudden_death")


# Path: foos/config.py

# 
# Path: foos/ui/ui.py
# def registerMenu(f):
#     menuGenerators.append(f)


# Path: plugins/game.py
from threading import Thread
from foos import config
from foos.ui.ui import registerMenu
import time
import logging

        else:
            self.game_end_time = None
            self.timeout_close_time = None

        self.sudden_death = False

    def notifyWinner(self, t, due_to_timeout=False):
        d = {'team': t, 'due_to_timeout': due_to_timeout}
        d.update(self.current_score)
        self.bus.notify('win_game', d)
        self.bus.notify('reset_score', d)

    def check_win(self):
        if self.game_win_score:
            for t in ['yellow', 'black']:
                if self.current_score.get(t, 0) >= self.game_win_score:
                    self.notifyWinner(t)

    def check_party_win(self, due_to_timeout=False):
        ys = self.current_score['yellow']
        yb = self.current_score['black']
        if ys > yb:
            self.notifyWinner('yellow', due_to_timeout)
        elif yb > ys:
            self.notifyWinner('black', due_to_timeout)
        else:
            logger.info("Timeout - No one wins yet. Sudden death activated")
            self.sudden_death = True
            self.bus.notify("sudden_death")


    def __run(self):