# Path: components/messages.py
# class QueryType(Enum):
#     StatModifier = 0
#     ExperiencePool = 1


from components.component import Component
from components.messages import QueryType
# TODO We need to fix the Class Instance Whatever here


class Race(Component):
    NAME = 'character_race'
    """
    Racial characteristics and bonuses
    """
    def __init__(self, uid, name, level_tree, body_template_uid):
        super().__init__()
        self.uid = uid
        self.name = name
        # TODO Some races won't be leveled, should acknowledge a level_tree of one
        # TODO and avoid registering a pool
        self.level_tree = level_tree
        self.body_template_uid = body_template_uid
        self.get_level = lambda: 0

    def copy(self):
        return Race(
            uid=self.uid,
            name=self.name,
            level_tree=self.level_tree,
            body_template_uid=self.body_template_uid
        )

    def on_register(self, host):
        super().on_register(host)
        host.register_query_responder(self, QueryType.StatModifier, self.respond_stat_modifier_query)
        if self.level_tree:

# Path: components/messages.py
# class QueryType(Enum):
#     StatModifier = 0
#     ExperiencePool = 1


# Path: components/race.py
from components.component import Component
from components.messages import QueryType

# TODO We need to fix the Class Instance Whatever here


class Race(Component):
    NAME = 'character_race'
    """
    Racial characteristics and bonuses
    """
    def __init__(self, uid, name, level_tree, body_template_uid):
        super().__init__()
        self.uid = uid
        self.name = name
        # TODO Some races won't be leveled, should acknowledge a level_tree of one
        # TODO and avoid registering a pool
        self.level_tree = level_tree
        self.body_template_uid = body_template_uid
        self.get_level = lambda: 0

    def copy(self):
        return Race(
            uid=self.uid,
            name=self.name,
            level_tree=self.level_tree,
            body_template_uid=self.body_template_uid
        )

    def on_register(self, host):
        super().on_register(host)
        host.register_query_responder(self, QueryType.StatModifier, self.respond_stat_modifier_query)
        if self.level_tree:

            results = host.transmit_query(self, QueryType.ExperiencePool, name=self.name)