import sys
#-- Dispatch class
class Dispatch(object):
    def __init__(self):
        self.table = {}
        self.sound_fx = ''

    def __call__(self, *args):
        return None
 
    def add_rule(self, cl1, cl2, func):
        self.table[(cl1, cl2)] = func

    def run(self, obj1, obj2, posx, posy, depth, normx, normy, world_dict):
        self.sound_fx = ''
        key = (obj1.__class__, obj2.__class__)
        print('dqwdqwd', file = sys.stderr)
              
        if (key in self.table):
            f = self.table[key]
            res = f(obj1, obj2, posx, posy, depth, normx, normy, world_dict, self)
            return res
        return False

