#NEWLINE# def load_spawns( self , spawn_list = None ) : #NEWLINE# #INDENT# '\n        Loads all of the spawns into this room, from either the given spawn_list\n        or the database.\n        ' #NEWLINE# if ( not spawn_list ) : #NEWLINE# #INDENT# spawn_list = self . world . db . select ( '* FROM room_spawns WHERE room=?' , [ self . dbid ] ) #NEWLINE# #UNINDENT# self . world . log . debug ( spawn_list ) #NEWLINE# dependencies = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for each in spawn_list : #NEWLINE# #INDENT# dependencies [ each [ 'id' ] ] = each [ 'container' ] #NEWLINE# del each [ 'container' ] #NEWLINE# #UNINDENT# self . world . log . debug ( ( 'Spawn_Dependencies {Spawn_id:container} ---: ' + str ( dependencies ) ) ) #NEWLINE# for row in spawn_list : #NEWLINE# #INDENT# row [ 'room' ] = self #NEWLINE# area = self . world . get_area ( row [ 'spawn_object_area' ] ) #NEWLINE# if cont : #NEWLINE# #INDENT# obj = getattr ( area , ( row [ 'spawn_type' ] + 's' ) ) . get ( row [ 'spawn_object_id' ] ) #NEWLINE# if obj : #NEWLINE# #INDENT# row [ 'obj' ] = obj #NEWLINE# self . world . log . debug ( row ) #NEWLINE# self . new_spawn ( row ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# for ( spawn_id , cont ) in dependencies . items ( ) : #NEWLINE# #INDENT# if cont : #NEWLINE# #INDENT# spawn = self . spawns . get ( spawn_id ) #NEWLINE# spawn . container = self . spawns . get ( cont ) #NEWLINE# spawn . container . add_nested_spawn ( self . spawns . get ( spawn_id ) ) #NEWLINE# spawn . save ( )