Example #1
0
 def set_species(sim_info: SimInfo, species: Union[Species, int]) -> bool:
     """
         Set the Species of a sim.
     """
     try:
         sim_info.species = species
         return True
     except Exception as ex:
         CommonExceptionHandler.log_exception(
             ModInfo.get_identity().name,
             'Failed to set species of sim {} to {}.'.format(
                 pformat(sim_info), species),
             exception=ex)
         return False
    def set_species(sim_info: SimInfo, species: Union[Species, int]) -> bool:
        """set_species(sim_info, species)

        Set the Species of a sim.

        :param sim_info: The Sim to set the Species of.
        :type sim_info: SimInfo
        :param species: The Species to set the Sim to.
        :type species: Union[Species, int]
        :return: True, if successful. False, if not.
        :rtype: bool
        """
        sim_info.species = species
        return True
    def set_species(sim_info: SimInfo, species: Union[Species, int]) -> bool:
        """set_species(sim_info, species)

        Set the Species of a sim.

        :param sim_info: The Sim to set the Species of.
        :type sim_info: SimInfo
        :param species: The Species to set the Sim to.
        :type species: Union[Species, int]
        :return: True, if successful. False, if not.
        :rtype: bool
        """
        try:
            sim_info.species = species
            return True
        except Exception as ex:
            CommonExceptionHandler.log_exception(ModInfo.get_identity(), 'Failed to set species of sim {} to {}.'.format(pformat(sim_info), species), exception=ex)
            return False