10 years ago
def get_objects_of_def_id_gen
Is the following function referring to the object Tuning IDs? And if so, please could you give me an example of use since the existing decompiled scripts don't seem to use it at all. def get_o...
"IngeJones;15205732" wrote:
Hmm ok I will give this one more chance. I wrote the code as:
def assign_bassinet_for_baby(sim_info, ignore_daycare=False):
object_manager = services.object_manager()
for bassinet in object_manager.get_objects_of_type_gen(*BabyTuning.BABY_BASSINET_DEFINITION_MAP.values()):
while not bassinet.transient:
set_baby_sim_info_with_switch_id(bassinet, sim_info, ignore_daycare=ignore_daycare)
bassinet.destroy(source=sim_info, cause='Assigned bassinet for baby.')
return True
definition_ids =
for bassinet in object_manager.get_objects_of_def_id_gen(*definition_ids):
while not bassinet.transient:
set_baby_sim_info_with_switch_id(bassinet, sim_info, ignore_daycare=ignore_daycare)
bassinet.destroy(source=sim_info, cause='Assigned bassinet for baby.')
return True
return False
I am not a python expert, and I hate trying to work out other people's uncommented python code because the lack of explicit typing makes it hard to work out what exact bit of data the function is expecting, especially when there are no usage examples in the existing python scripts.