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


from components.component import Component
from components.messages import QueryType


class CharacterClass(Component):
    NAME = 'character_class'

    # TODO ExperiencePool should itself be a component and be stripped off here.
    # TODO This component should instead MESSAGE the experience pool to register one.
    def __init__(self, uid, name, level_tree, hit_die):
        super().__init__()
        self.uid = uid
        self.name = name
        self.level_tree = level_tree
        self.get_level = lambda: 0
        self.hit_die = hit_die

    def copy(self):
        return CharacterClass(
            uid=self.uid,
            name=self.name,
            level_tree=self.level_tree,
            hit_die=self.hit_die
        )

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

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


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



class CharacterClass(Component):
    NAME = 'character_class'

    # TODO ExperiencePool should itself be a component and be stripped off here.
    # TODO This component should instead MESSAGE the experience pool to register one.
    def __init__(self, uid, name, level_tree, hit_die):
        super().__init__()
        self.uid = uid
        self.name = name
        self.level_tree = level_tree
        self.get_level = lambda: 0
        self.hit_die = hit_die

    def copy(self):
        return CharacterClass(
            uid=self.uid,
            name=self.name,
            level_tree=self.level_tree,
            hit_die=self.hit_die
        )

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

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