# Path: stats/enums.py
# class StatsEnum(Enum):
#     Health = 'health'
#     Mana = 'mana'
#     Strength = 'strength'
#     Dexterity = 'dexterity'
#     Constitution = 'constitution'
#     Intelligence = 'intelligence'
#     Charisma = 'charisma'
#     Wisdom = 'wisdom'
#     Sharpness = 'sharpness'
#     Hardness = 'hardness'
#     Weight = 'weight'
#     Size = 'size'
#     Potency = 'potency'
#     MaxDamage = 'max_damage'
#     MinDamage = 'min_damage'
#     ArmorClass = 'armor_class'
# 
# Path: util/decorators.py
# def cached(func):
#     def wrapper(*args, **kwargs):
#         host = args[0]
#         if not hasattr(host, 'cache'):
#             setattr(host, 'cache', {})
# 
#         if func not in host.cache:
#             host.cache[func] = func(*args, **kwargs)
# 
#         return host.cache[func]
# 
#     return wrapper
# 
# def invalidate_cache(func):
#     def wrapper(*args, **kwargs):
#         host = args[0]
#         if hasattr(host, 'cache'):
#             host.cache = {}
#         return func(*args, **kwargs)
# 
#     return wrapper


from components.component import Component
from stats.enums import StatsEnum
from itertools import chain
from util.decorators import cached, invalidate_cache
                for compatible_bodypart_uid in armor.wearable_body_parts_uid:
                    host_body_parts = self.host_body.get_body_parts(compatible_bodypart_uid)
                    for host_body_part in host_body_parts:
                        if host_body_part:
                            if host_body_part in self.worn_equipment_map:
                                if armor.worn_layer not in [item.armor.worn_layer for item in
                                                            self.worn_equipment_map[host_body_part]]:
                                    self.worn_equipment_map[host_body_part].append(item)
                                    return True
                            else:
                                self.worn_equipment_map[host_body_part] = [item]
                                return True
        return False

    @invalidate_cache
    def wield(self, item):
        if not self.host_body:
            self.host_body = self.host.body

        # Wielding requires bodyparts with GRASP
        grasp_able_body_parts = self.host_body.get_grasp_able_body_parts()
        # Wielding with one hand gets priority
        two_hands_wielders = []
        for grasp_able_body_part in grasp_able_body_parts:
            if grasp_able_body_part in self.wielded_equipment_map:
                continue

            # 10 is the normal relative_size for a hand
            relative_size_modifier = grasp_able_body_part.relative_size - 10
            relative_size_modifier = round(relative_size_modifier / 10) if relative_size_modifier else 0

# Path: stats/enums.py
# class StatsEnum(Enum):
#     Health = 'health'
#     Mana = 'mana'
#     Strength = 'strength'
#     Dexterity = 'dexterity'
#     Constitution = 'constitution'
#     Intelligence = 'intelligence'
#     Charisma = 'charisma'
#     Wisdom = 'wisdom'
#     Sharpness = 'sharpness'
#     Hardness = 'hardness'
#     Weight = 'weight'
#     Size = 'size'
#     Potency = 'potency'
#     MaxDamage = 'max_damage'
#     MinDamage = 'min_damage'
#     ArmorClass = 'armor_class'
# 
# Path: util/decorators.py
# def cached(func):
#     def wrapper(*args, **kwargs):
#         host = args[0]
#         if not hasattr(host, 'cache'):
#             setattr(host, 'cache', {})
# 
#         if func not in host.cache:
#             host.cache[func] = func(*args, **kwargs)
# 
#         return host.cache[func]
# 
#     return wrapper
# 
# def invalidate_cache(func):
#     def wrapper(*args, **kwargs):
#         host = args[0]
#         if hasattr(host, 'cache'):
#             host.cache = {}
#         return func(*args, **kwargs)
# 
#     return wrapper


# Path: components/equipment.py
from components.component import Component
from stats.enums import StatsEnum
from itertools import chain
from util.decorators import cached, invalidate_cache

                for compatible_bodypart_uid in armor.wearable_body_parts_uid:
                    host_body_parts = self.host_body.get_body_parts(compatible_bodypart_uid)
                    for host_body_part in host_body_parts:
                        if host_body_part:
                            if host_body_part in self.worn_equipment_map:
                                if armor.worn_layer not in [item.armor.worn_layer for item in
                                                            self.worn_equipment_map[host_body_part]]:
                                    self.worn_equipment_map[host_body_part].append(item)
                                    return True
                            else:
                                self.worn_equipment_map[host_body_part] = [item]
                                return True
        return False

    @invalidate_cache
    def wield(self, item):
        if not self.host_body:
            self.host_body = self.host.body

        # Wielding requires bodyparts with GRASP
        grasp_able_body_parts = self.host_body.get_grasp_able_body_parts()
        # Wielding with one hand gets priority
        two_hands_wielders = []
        for grasp_able_body_part in grasp_able_body_parts:
            if grasp_able_body_part in self.wielded_equipment_map:
                continue

            # 10 is the normal relative_size for a hand
            relative_size_modifier = grasp_able_body_part.relative_size - 10
            relative_size_modifier = round(relative_size_modifier / 10) if relative_size_modifier else 0

            relative_size = self.host.stats.get_current_value(StatsEnum.Size) + relative_size_modifier