My objects all have two functions XLoad (load from XML-node) and XSave (store data in XML-node). So saving a level from within a leveleditor or midgame is handled the same. I use a speaking name (string) as ID, so I don't need to mess with pointers or numbers and I can easily load/save/identify every object by it's name.
This might be too slow for huge games and giant levels, but for a few hundred objects this approach is fast enough.
This might be too slow for huge games and giant levels, but for a few hundred objects this approach is fast enough.