1 #ifndef DFRPG_H 2 #define DFRPG_H 3 4 #include "datafile.h" 5 #include <map> 6 #include "common.h" 7 8 struct Skill : public Named 9 { 10 std::string /*name*/ symbol, description; 11 std::string multiplier; 12 std::vector<std::string> statNames; 13 }; 14 struct Group 15 { 16 std::string name, description; 17 std::vector<Named*> skills; 18 }; 19 20 struct ItemTag 21 { 22 std::string name, description; 23 }; 24 25 typedef std::vector<std::string> SyllableLine; 26 struct Syllables 27 { 28 std::vector<SyllableLine> first, mid, end; 29 }; 30 31 class DFRpg : public DataFile<Group> 32 { 33 public: 34 std::vector<ItemTag*> itemTags; 35 Syllables syllables; 36 37 protected: 38 bool LoadSingle(std::ifstream*, Group*); 39 40 bool ParseSkill(std::ifstream*, Group*); 41 42 void LoadItemTags(std::ifstream*); 43 void LoadSyllables(std::ifstream*); 44 public: 45 ~DFRpg(); 46 47 void Save(); 48 49 void SaveSkill(std::ofstream&, Skill*); 50 51 void SaveItemTags(std::ofstream&); 52 void SaveSyllables(std::ofstream&); 53 }; 54 55 #endif // DFRPG_H 56