# Path: compositecore.py
# class Leaf(Component):
#     """
#     Abstract leaf class of composite design pattern.
# 
#     Component classes of leaf type should inherit from this class.
#     """
# 
#     def __init__(self):
#         super(Leaf, self).__init__()
# 
#     def get_relative_of_type(self, component_type):
#         return self.parent.get_child_or_ancestor(component_type)
# 
#     def has_relative_of_type(self, component_type):
#         return self.parent.has_child_or_ancestor(component_type)


from compositecore import Leaf


class Flag(Leaf):
    """
    Component which only has a component type. Composites with this component has this flag.
    """
    def __init__(self, component_type):
        super(Flag, self).__init__()
        self.component_type = component_type


class DataPointBonusSpoof(Leaf):
    """
    Defines a bonus value, if this is added to an entity as spoof.
    The entity will get that bonus added to the normal value.
    """
    def __init__(self, component_type, bonus_value):
        super(DataPointBonusSpoof, self).__init__()
        self.component_type = component_type
        self.bonus_value = bonus_value

    @property
    def value(self):
        return self.next.value + self.bonus_value

    @value.setter
    def value(self, new_value):
        self.next.value = new_value



# Path: compositecore.py
# class Leaf(Component):
#     """
#     Abstract leaf class of composite design pattern.
# 
#     Component classes of leaf type should inherit from this class.
#     """
# 
#     def __init__(self):
#         super(Leaf, self).__init__()
# 
#     def get_relative_of_type(self, component_type):
#         return self.parent.get_child_or_ancestor(component_type)
# 
#     def has_relative_of_type(self, component_type):
#         return self.parent.has_child_or_ancestor(component_type)


# Path: stats.py
from compositecore import Leaf



class Flag(Leaf):
    """
    Component which only has a component type. Composites with this component has this flag.
    """
    def __init__(self, component_type):
        super(Flag, self).__init__()
        self.component_type = component_type


class DataPointBonusSpoof(Leaf):
    """
    Defines a bonus value, if this is added to an entity as spoof.
    The entity will get that bonus added to the normal value.
    """
    def __init__(self, component_type, bonus_value):
        super(DataPointBonusSpoof, self).__init__()
        self.component_type = component_type
        self.bonus_value = bonus_value

    @property
    def value(self):
        return self.next.value + self.bonus_value

    @value.setter
    def value(self, new_value):
        self.next.value = new_value



class Damage(Leaf):