Destroying a World

Jul 22, 2011 at 7:10 AM


I couldn't find a method in World objects to destroy them. There's no World.Dispose() or anything . . . how does a person destroy their world? What do I need to do to make sure it is done properly?

Jul 22, 2011 at 8:45 AM

Since you are in .Net your world object should be deleted as soon as there are no more references to it. Your world and all objects in the world will be destroyed when there is no living object referencing it.

I don't think there is a need to Dispose of the world object.

Jul 22, 2011 at 12:55 PM

I see. Maybe it would help if I mention my idea:

I was thinking of a gamestate stack, each state on the stack having a different world. This would allow me to easily push a new state onto the stack without affecting anything that is already on the stack. I suppose it would be possible to do this with one world, but having one for each gamestate is a much more organized and coherent solution, for my needs.