Interaction Registration
Interaction Registry
- class BBInteractionRegistry(*args, **kwargs)
Bases:
objectA registry for putting interactions onto Sims, Objects, Terrain, and other places.
- classmethod register()
Make the registry know about your handler.
Usage: @BBInteractionRegistry.register() class BBExampleSimHandler(BBSimInteractionHandler):
- Returns:
A callable that creates an instance.
- Return type:
Callable[[Type[BBInteractionHandler]], BBInteractionHandler]
- register_interaction_handler(interaction_handler)
Manually register a handler for interactions.
- Parameters:
interaction_handler (BBInteractionHandler) – The handler being registered.
Interaction Handler
Interaction Location
Object Interaction Handler
- class BBObjectInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on Game Objects that are not Sims.
@BBInteractionRegistry.register() class _ExampleObjectInteractionRegistration(BBObjectInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, ) def should_register(self, game_object: GameObject) -> bool: super_result = super().should_register(game_object) if not super_result: return super_result # If matches specific id. return game_object.id == 5678
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.
Sim Interaction Handler
- class BBSimInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on Sims.
@BBInteractionRegistry.register() class _ExampleSimInteractionRegistration(BBSimInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, ) def should_register(self, sim: Sim) -> bool: super_result = super().should_register(sim) if not super_result: return super_result # Only register these interactions to Young Adult Sims. return sim.age == Age.YOUNGADULT
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.
Terrain Interaction Handler
- class BBTerrainInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on the Terrain (Does not include Oceans).
@BBInteractionRegistry.register() class _ExampleTerrainInteractionRegistration(BBTerrainInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, )
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.
Ocean Interaction Handler
- class BBOceanInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on the Ocean and Pools.
@BBInteractionRegistry.register() class _ExampleOceanInteractionRegistration(BBOceanInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, )
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.
Phone Interaction Handler
- class BBPhoneInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on the Phone.
@BBInteractionRegistry.register() class _ExamplePhoneInteractionRegistration(BBPhoneInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, )
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.
Relationship Panel Interaction Handler
- class BBRelationshipPanelInteractionHandler
Bases:
BBInteractionHandlerA handler for registering interactions on the Relationship Panel.
@BBInteractionRegistry.register() class _ExampleRelationshipPanelInteractionRegistration(BBRelationshipPanelInteractionHandler): @property def interaction_guids(self) -> Tuple[int]: return ( 12345, )
- property interaction_guids
A collection of interaction GUIDs to register.
- property registration_location
The location for which interactions will be registered.