Link to home
Start Free TrialLog in
Avatar of Valleriani
VallerianiFlag for Sweden

asked on

VC++ 2010 - Best way to save a set of variables for an object?

This is in VC++ 2010.

I'm trying to figure out how to save this information properly and load it per game session at the moment. What I'm trying to save is a 'ship loadout'. A ship loadout would be the EQUIPMENT on a ship. All equipment have an ID, and that's all I'm trying to save, a bunch of ID's for each ship you use.

First off, it can't be static, each ship has a set have a amount of equipment slots (Which I can grab the amount per ship), but it is different per ship. I want to be able to save ship loadouts PER SHIP. (Which I'll be using the numeric keys to save and load ships.) Each ship also has an ID it can call.

So what I want is each ship ID will have ship loadouts assigned to it that can be saved or loaded for future use. I was aiming to have 3 loadouts per ship maximum, if that helps anyone. Again, all I need is the equipment IDs that can be assigned to each ship ID, which I can grab on a ship very easily. All IDS are 5 digits long.

I'm not asking for full fledged coding, I'm mainly asking for a way to store this properly, possibly with a small example using dummy coding to save.

SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Member_2_5069294
Member_2_5069294

I understand the question but I'm not sure what the problem is?  Generating the ID's?  Saving the file? Dealing with different number of ID's for each ship?  It looks quite straightforward to me, perhaps I'm missing something.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>XML files would result in a lot of memory use

Um, they're stored on disk, so why would they cause memory usage?