def get_tags(self) -> Tuple[OCCASPartQueryTag]: result: Tuple[OCCASPartQueryTag] = ( OCCASPartQueryTag(OCCASPartTagType.AGE, CommonAgeUtils.get_age(self._sim_info)), OCCASPartQueryTag(OCCASPartTagType.GENDER, CommonGenderUtils.get_gender(self._sim_info)), OCCASPartQueryTag(OCCASPartTagType.SPECIES, CommonSpecies.get_species(self._sim_info)), ) return result
def __str__(self) -> str: return '{}: {}, Age: {}, Gender: {}, Species: {}'.format( self.__class__.__name__, CommonSimNameUtils.get_full_name(self._sim_info), CommonAgeUtils.get_age(self._sim_info), CommonGenderUtils.get_gender(self._sim_info), CommonSpecies.get_species(self._sim_info) )
def _on_sim_change_gender(self, sim_info: SimInfo) -> bool: from sims4communitylib.utils.sims.common_gender_utils import CommonGenderUtils new_gender = CommonGenderUtils.get_gender(sim_info) if CommonGenderUtils.is_male_gender(new_gender): # If they are now Male, it means they used to be Female. old_gender = Gender.FEMALE else: # If they are now Female, it means they used to be Male. old_gender = Gender.MALE return CommonEventRegistry.get().dispatch(S4CLSimChangedGenderEvent(sim_info, old_gender, new_gender))
def get_tags(self) -> Tuple[CSFSliderQueryTag]: result: Tuple[CSFSliderQueryTag] = ( CSFSliderQueryTag(CSFSliderTagType.GENDER, CommonGenderUtils.get_gender(self._sim_info)), CSFSliderQueryTag(CSFSliderTagType.AGE, CommonAgeUtils.get_age(self._sim_info)), CSFSliderQueryTag(CSFSliderTagType.SPECIES, CommonSpecies.get_species(self._sim_info)), ) return result
def has_preference_for(sim_info: SimInfo, target_sim_info: SimInfo, like_threshold: int = None, love_threshold: int = None) -> bool: """has_preference_for(sim_info, target_sim_info, like_threshold=None, love_threshold=None) Determine if a Sim has a preference for another Sim. :param sim_info: An instance of a Sim. :type sim_info: SimInfo :param target_sim_info: An instance of a Sim. :type target_sim_info: SimInfo :param like_threshold: A value indicating a low amount of preference. Default is CommonSimGenderPreferenceUtils.LOW_PREFERENCE_THRESHOLD. :type like_threshold: int, optional :param love_threshold: A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD. :type love_threshold: int, optional :return: True, if the Sim has a preference for the Gender. False, if not. :rtype: bool """ return CommonSimGenderPreferenceUtils.has_preference_for_gender( sim_info, CommonGenderUtils.get_gender(target_sim_info), like_threshold=like_threshold, love_threshold=love_threshold)