def _load(self, initial_outfit_parts: Dict[BodyType, int]=None) -> bool:
        target_sim_name = CommonSimNameUtils.get_full_name(self.sim_info)
        self._outfit_data: OutfitData = CommonOutfitUtils.get_outfit_data(self.sim_info, outfit_category_and_index=self._outfit_category_and_index)
        if self._outfit_data is None:
            self.log.error('Missing outfit data for Sim \'{}\' and Outfit Category and Index {}'.format(target_sim_name, self._outfit_category_and_index), throw=True)
            return False
        self._outfit_parts = CommonOutfitUtils.get_outfit_parts(self.sim_info, outfit_category_and_index=self._outfit_category_and_index)
        self._original_outfit_data: FrozenSet[int] = frozenset(self._outfit_parts.items())
        if initial_outfit_parts is not None:
            for (key, value) in initial_outfit_parts.items():
                if not isinstance(key, int) or not isinstance(value, int):
                    self.log.error('\'{}\': outfit_body_parts contains non-integer variables key: {} value: {}.'.format(target_sim_name, key, value))
                    return False

            self._outfit_body_types = list(initial_outfit_parts.keys())
            self._outfit_part_ids = list(initial_outfit_parts.values())
        else:
            if not self._outfit_data.part_ids or not self._outfit_data.body_types:
                self.log.error('\'{}\' is missing outfit parts or body types for Outfit Category and Index {}.'.format(target_sim_name, self._outfit_category_and_index))
                return False
            self._outfit_body_types: List[Union[BodyType, int]] = list(self._outfit_data.body_types)
            self._outfit_part_ids: List[int] = list(self._outfit_data.part_ids)
            if len(self._outfit_body_types) != len(self._outfit_part_ids):
                self.log.error('\'{}\': The number of outfit parts did not match the number of body types for Outfit Category and Index {}.'.format(target_sim_name, self._outfit_category_and_index))
                return False
        return True
    def has_cas_part_attached(
            sim_info: SimInfo,
            cas_part_id: int,
            body_type: Union[BodyType, int, None] = BodyType.NONE,
            outfit_category_and_index: Tuple[OutfitCategory,
                                             int] = None) -> bool:
        """has_cas_part_attached(sim_info, cas_part_id, body_type=BodyType.NONE, outfit_category_and_index=None)

        Determine if a Sim has the specified CAS part attached to their outfit.

        :param sim_info: The SimInfo of the Sim to check.
        :type sim_info: SimInfo
        :param cas_part_id: A decimal identifier of the CAS part to locate.
        :type cas_part_id: int
        :param body_type: The BodyType the CAS part will be located at. If no value is provided, it defaults to the BodyType of the CAS part itself. If set to None, the CAS part will be located within any BodyType.
        :type body_type: Union[BodyType, int, None], optional
        :param outfit_category_and_index: The outfit category and index of the Sims outfit to check. Default is the Sims current outfit.
        :type outfit_category_and_index: Union[Tuple[OutfitCategory, int], None], optional
        :return: True, if the Sims outfit contain the specified CAS part. False, if the Sims outfit does not contain the specified CAS part.
        :rtype: bool
        """
        log.format_with_message(
            'Checking if CAS part is attached to Sim.',
            sim=sim_info,
            cas_part_id=cas_part_id,
            body_type=body_type,
            outfit_category_and_index=outfit_category_and_index)
        if body_type == BodyType.NONE:
            body_type = CommonCASUtils.get_body_type_of_cas_part(cas_part_id)
        if outfit_category_and_index is None:
            outfit_category_and_index = CommonOutfitUtils.get_current_outfit(
                sim_info)
        log.format(body_type=body_type,
                   outfit_category_and_index=outfit_category_and_index)
        outfit_parts = CommonOutfitUtils.get_outfit_parts(
            sim_info, outfit_category_and_index=outfit_category_and_index)
        if not outfit_parts:
            log.debug('No body parts found.')
            return False
        log.format_with_message('Found body parts from outfit.',
                                body_parts=outfit_parts)
        if body_type is None:
            log.debug('No BodyType specified.')
            return cas_part_id in outfit_parts.values()
        if body_type not in outfit_parts:
            log.debug('Specified BodyType not found within body parts.')
            return False
        log.debug('BodyType found within Sims outfit parts.')
        attached_cas_part_id = outfit_parts[body_type]
        log.format(attached_cas_part_id=attached_cas_part_id)
        return cas_part_id == attached_cas_part_id
    def get_body_type_cas_part_is_attached_to(
        sim_info: SimInfo,
        cas_part_id: int,
        outfit_category_and_index: Tuple[OutfitCategory, int] = None
    ) -> Union[BodyType, int]:
        """get_body_type_cas_part_is_attached_to(sim_info, cas_part_id, outfit_category_and_index=None)

        Retrieve the BodyType that a CAS part is attached to within a Sims outfit.

        :param sim_info: The SimInfo of the Sim to check.
        :type sim_info: SimInfo
        :param cas_part_id: A decimal identifier of the CAS part to locate.
        :type cas_part_id: int
        :param outfit_category_and_index: The outfit category and index of the Sims outfit to check. If None, the current outfit of the Sim will be used.
        :type outfit_category_and_index: Tuple[OutfitCategory, int], optional
        :return: The BodyType the specified CAS part id is attached to or BodyType.NONE if the CAS part is not found or the Sim does not have body parts for their outfit.
        :rtype: Union[BodyType, int]
        """
        log.format_with_message(
            'Retrieving BodyType for CAS part.',
            sim=sim_info,
            cas_part_id=cas_part_id,
            outfit_category_and_index=outfit_category_and_index)
        if outfit_category_and_index is None:
            outfit_category_and_index = CommonOutfitUtils.get_current_outfit(
                sim_info)
        log.format(cas_part_id=cas_part_id,
                   outfit_category_and_index=outfit_category_and_index)
        outfit_parts = CommonOutfitUtils.get_outfit_parts(
            sim_info, outfit_category_and_index=outfit_category_and_index)
        if not outfit_parts:
            log.debug('No body parts found on Sim!')
            return BodyType.NONE
        log.format_with_message('Found body parts from outfit.',
                                body_parts=outfit_parts)
        for body_type in outfit_parts.keys():
            if cas_part_id != outfit_parts[body_type]:
                continue
            # noinspection PyBroadException
            try:
                body_type = BodyType(body_type)
            except:
                body_type = body_type
            log.format_with_message(
                'Found the BodyType the specified CAS part is attached to.',
                body_type=body_type)
            return body_type
        log.debug('No BodyType was found matching the specified CAS part.')
        return BodyType.NONE
    def get_cas_part_id_at_body_type(
            sim_info: SimInfo,
            body_type: Union[BodyType, int],
            outfit_category_and_index: Tuple[OutfitCategory,
                                             int] = None) -> int:
        """get_cas_part_id_at_body_type(sim_info, body_type, outfit_category_and_index=None)

        Retrieve the CAS part identifier attached to the specified BodyType within a Sims outfit.

        :param sim_info: The SimInfo of the Sim to check.
        :type sim_info: SimInfo
        :param body_type: The BodyType to check.
        :type body_type: Union[BodyType, int]
        :param outfit_category_and_index: The outfit category and index of the Sims outfit to check. Default is the Sims current outfit.
        :type outfit_category_and_index: Tuple[OutfitCategory, int], optional
        :return: The CAS part identifier attached to the specified BodyType or -1 if the BodyType is not found.
        :rtype: int
        """
        log.format_with_message(
            'Checking if CAS part is attached to Sim.',
            sim=sim_info,
            body_type=body_type,
            outfit_category_and_index=outfit_category_and_index)
        if outfit_category_and_index is None:
            outfit_category_and_index = CommonOutfitUtils.get_current_outfit(
                sim_info)
        log.format(body_type=body_type,
                   outfit_category_and_index=outfit_category_and_index)
        outfit_parts = CommonOutfitUtils.get_outfit_parts(
            sim_info, outfit_category_and_index=outfit_category_and_index)
        if not outfit_parts:
            log.debug('No body_parts found on Sim.')
            return -1
        log.format_with_message('Found body parts from outfit.',
                                body_parts=outfit_parts)
        if body_type not in outfit_parts:
            log.debug(
                'The specified BodyType was not found within the Sims outfit.')
            return -1
        log.debug(
            'BodyType has been found within Sims outfit parts. Returning the CAS part belonging to it.'
        )
        return outfit_parts[body_type]
    def get_body_type_cas_part_is_attached_to(
        sim_info: SimInfo,
        cas_part_id: int,
        outfit_category_and_index: Tuple[OutfitCategory,
                                         int] = None) -> BodyType:
        """get_body_type_cas_part_is_attached_to(sim_info, cas_part_id, outfit_category_and_index=None)

        Retrieve the BodyType that a cas part is attached to within a Sims outfit.

        :param sim_info: The SimInfo of the Sim to check.
        :type sim_info: SimInfo
        :param cas_part_id: A decimal identifier of the CAS part to locate.
        :type cas_part_id: int
        :param outfit_category_and_index: The outfit category and index of the Sims outfit to check. Default is the Sims current outfit.
        :type outfit_category_and_index: Tuple[OutfitCategory, int], optional
        :return: The BodyType the specified cas part id is attached to or -1 if the cas part is not found.
        :rtype: BodyType
        """
        log.format_with_message(
            'Retrieving BodyType for cas part.',
            sim=sim_info,
            cas_part_id=cas_part_id,
            outfit_category_and_index=outfit_category_and_index)
        if outfit_category_and_index is None:
            outfit_category_and_index = CommonOutfitUtils.get_current_outfit(
                sim_info)
        log.format(cas_part_id=cas_part_id,
                   outfit_category_and_index=outfit_category_and_index)
        outfit_parts = CommonOutfitUtils.get_outfit_parts(
            sim_info, outfit_category_and_index=outfit_category_and_index)
        if not outfit_parts:
            log.debug('No body parts found.')
            return BodyType.NONE
        log.format_with_message('Found body parts from outfit.',
                                body_parts=outfit_parts)
        for body_type in outfit_parts.keys():
            if cas_part_id != outfit_parts[body_type]:
                continue
            log.format_with_message('Found BodyType.',
                                    body_type=BodyType(body_type))
            return BodyType(body_type)
        log.debug('No BodyType found matching the cas part.')
        return BodyType.NONE