1 #pragma once 2 #include <string> 3 #include <vector> 4 #include <map> 5 6 7 // single track on championship 8 class ChampTrack 9 { 10 public: 11 std::string name; bool reversed; // track 12 int laps; // number of laps 13 //float factor; // time factor (difficulty) - how near to best time you need to drive 14 float passScore; 15 ChampTrack(); 16 }; 17 18 // one championship data 19 class Champ 20 { 21 public: 22 std::string name, descr; // champ description 23 int diff; // difficulty 24 int ver; // ver, if changed reset progress.. 25 float length; // stats to display 26 int type; // tutorial, champ easy, normal etc 27 float time; // total, computed (sum of all tracks) 28 29 std::vector<ChampTrack> trks; 30 Champ(); isTut()31 bool isTut() const { return type < 2; } 32 }; 33 34 35 ///----- all championships and tutorials 36 // 37 class ChampsXml 38 { 39 public: 40 std::vector<Champ> all; 41 42 bool LoadXml(std::string file, class TracksXml* times, bool check); 43 ChampsXml(); 44 }; 45 46 47 // progress on single track 48 class ProgressTrack 49 { 50 public: 51 float points; 52 ProgressTrack(); 53 }; 54 55 // progress on championship 56 class ProgressChamp 57 { 58 public: 59 int curTrack; // index to current track, in trks 60 float points; 61 62 // for ver changed checking.. 63 std::string name; 64 int ver; 65 66 std::vector<ProgressTrack> trks; 67 ProgressChamp(); 68 }; 69 70 71 ///----- progress on champs,tuts and their tracks 72 // 73 class ProgressXml 74 { 75 public: 76 std::vector<ProgressChamp> chs; 77 bool LoadXml(std::string file), SaveXml(std::string file); 78 }; 79