On 6/7/07, Andrew Phillips <[EMAIL PROTECTED]> wrote:
Hey, welcome back :-).
I've established some very limited attribute and property classes, though I have yet to integrate them with the existing character class. I'd like to get cracking on charedit's file operations as well, so I'd like to make sure there isn't already a desired file format for characters. If it does exist, where in CVS should I be looking? If not, what should it look like?
So far, there isn't. There also isn't any specific way it should look like. Form follows function in this case. The only real requirement is to stick with the general "conventions" for loading/saving: I.e. all classes have the pair of methods void put_state (base::flat & file) const bool get_state (base::flat & file) As an addition, the rpg/character class might also get the pair bool save (const std::string & fname) const bool load (const std::string & filename) The first pair can be used to save/load a whole list of characters into/from a stream, the second pair would save/load one character into/from a file it creates itself. A good example would be http://cvs.savannah.nongnu.org/viewvc/adonthell/src/world/character_with_gfx.cc?root=adonthell&view=markup A general example for the saving/loading mechanism is http://cvs.savannah.nongnu.org/viewvc/adonthell/test/diskiotest.cc?root=adonthell&view=markup When saving to a file you have the option to create a GZ_FILE or an XML_FILE. I suggest using latter, so you can more easily look at the contents of the file and modify it. Let me know if you have further questions. Kai P.S.: What's your current development environment? Do you still work on Windows? And if so, did you get a chance to follow that README.Win32? _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/adonthell-devel