Advertisement

Boost serialization savegame question

Started by May 10, 2011 12:19 AM
0 comments, last by TheUnbeliever 13 years, 6 months ago
Hello
I have a question about using Boost serialization for saving a game. What I have is one class that defines properties of certain object like a Car and then I have a class for the instance of the Car. So I have CarData and Car classes.


The question is will saving work if I just save the Car class to file and load the CarData by other means?

Because The Car class depends of pointer to the CarData but the CarData should not be saved in savegame file because its loaded from xml to behin with.

thx
Associate some ID with CarData then either have the Car class store this ID, or continue storing a pointer and find the pointer from the ID when you load the save game. Obviously either way, you need some way of getting from the handle to the concrete class. A problem with this solution is what to do if the XML is updated so that the IDs in saved games are no longer valid.
[TheUnbeliever]

This topic is closed to new replies.

Advertisement