Beispiel #1
0
    def send_to_position(sim_info: SimInfo, location_position: Vector3,
                         level: int) -> Union[EnqueueResult, None]:
        """send_to_position(sim_info, location_position, level)

        Send a Sim to the specified location.

        :param sim_info: The Sim to send.
        :type sim_info: SimInfo
        :param location_position: The position to send the sim to.
        :type location_position: Vector3
        :param level: The level at which the position is.
        :type level: int
        :return: The result of sending the Sim to the specified location or None if they could not go there.
        :rtype: EnqueueResult
        """
        from server_commands.sim_commands import _build_terrain_interaction_target_and_context, CommandTuning
        if location_position is None:
            return None
        sim = CommonSimUtils.get_sim_instance(sim_info)
        # noinspection PyUnresolvedReferences
        pos = sims4.math.Vector3(location_position.x, location_position.y,
                                 location_position.z)
        routing_surface = routing.SurfaceIdentifier(
            CommonLocationUtils.get_current_lot_id(), level,
            routing.SurfaceType.SURFACETYPE_WORLD)
        (target, context) = _build_terrain_interaction_target_and_context(
            sim, pos, routing_surface, PickType.PICK_TERRAIN,
            objects.terrain.TerrainPoint)
        return sim.push_super_affordance(
            CommandTuning.TERRAIN_GOHERE_AFFORDANCE, target, context)
    def is_renting_current_lot(sim_info: SimInfo) -> bool:
        """is_renting_current_lot(sim_info)

        Determine if a Sim is renting the current lot.

        :param sim_info: The Sim to check.
        :type sim_info: SimInfo
        :return: True, if the Sim is renting the active lot. False, if not.
        :rtype: bool
        """
        return sim_info.is_renting_zone(
            CommonLocationUtils.get_current_lot_id())
Beispiel #3
0
    def is_at_home(sim_info: SimInfo) -> bool:
        """is_at_home(sim_info)

        Determine if a Sim is currently at home.

        :param sim_info: The Sim to check.
        :type sim_info: SimInfo
        :return: True, if the Sim is at their home lot. False, if not.
        :rtype: bool
        """
        active_lot = CommonLocationUtils.get_current_lot()
        return CommonLocationUtils.get_current_lot_id(
        ) == CommonHouseholdUtils.get_household_lot_id(
            sim_info) and active_lot.is_position_on_lot(
                CommonSimLocationUtils.get_position(sim_info))
 def is_renting_current_lot(sim_info: SimInfo) -> bool:
     """ Determine if a Sim is renting the current lot. """
     return sim_info.is_renting_zone(
         CommonLocationUtils.get_current_lot_id())