C
CedSharp
Guest
I have a complex structure for storing information.
Very briefly, it looks as follow:
It is more complex than that, but the above shows my point.
I would like to call one single script to get rid of all the data structures, recursively, inside the dialog variable.
So basically everything but the ds_queue in which _assign_dialog() appends to should be destroyed.
Does gamemaker support destroying and freeing memory for all data structures inside a data-structure?
For example, if I call ds_grid_destroy( dialog ), will it also free all the underlying grids and queues ?
Or do I have to recursively call destroy and clear on each of those myself?
Thanks.
Very briefly, it looks as follow:
Code:
/*
_collection( ... ) will generate a queue with each argument as a value.
_message( text ) will generate a 2x1 grid, first position containing an enum value, second a string.
_dialog( name, collection ) will create a 2x1 grid with the 2 parameters.
_assign_dialog( dialog ) will append the dialog to the queue of the current object created in create event.
*/
var dialog = _dialog( "My dialog",
_collection(
_message( "first message" ),
_message( "second message" ),
_message( "third message" )
)
);
_assign_dialog( dialog );
I would like to call one single script to get rid of all the data structures, recursively, inside the dialog variable.
So basically everything but the ds_queue in which _assign_dialog() appends to should be destroyed.
Does gamemaker support destroying and freeing memory for all data structures inside a data-structure?
For example, if I call ds_grid_destroy( dialog ), will it also free all the underlying grids and queues ?
Or do I have to recursively call destroy and clear on each of those myself?
Thanks.