40 QString Hat; |
40 QString Hat; |
41 int Rounds, Kills, Deaths, Suicides; |
41 int Rounds, Kills, Deaths, Suicides; |
42 }; |
42 }; |
43 |
43 |
44 // class representing a team |
44 // class representing a team |
45 class HWTeam |
45 class HWTeam : public QObject |
46 { |
46 { |
|
47 Q_OBJECT |
|
48 |
47 public: |
49 public: |
48 |
50 |
49 // constructors |
51 // constructors |
50 HWTeam(const QString & teamname); |
52 HWTeam(const QString & teamname); |
51 HWTeam(const QStringList& strLst); |
53 HWTeam(const QStringList& strLst); |
52 HWTeam(); |
54 HWTeam(); |
|
55 HWTeam(const HWTeam & other); |
53 |
56 |
54 // file operations |
57 // file operations |
|
58 static HWTeam loadFromFile(const QString & teamName); |
55 bool loadFromFile(); |
59 bool loadFromFile(); |
56 bool deleteFile(); |
60 bool deleteFile(); |
57 bool saveToFile(); |
61 bool saveToFile(); |
58 bool fileExists(); |
62 bool fileExists(); |
59 |
63 |
64 QString flag() const; |
68 QString flag() const; |
65 QString fort() const; |
69 QString fort() const; |
66 QString grave() const; |
70 QString grave() const; |
67 const HWHog & hedgehog(unsigned int idx) const; |
71 const HWHog & hedgehog(unsigned int idx) const; |
68 bool isNetTeam() const; |
72 bool isNetTeam() const; |
|
73 QString keyBind(unsigned int idx) const; |
69 QString name() const; |
74 QString name() const; |
70 unsigned char numHedgehogs() const; |
75 unsigned char numHedgehogs() const; |
71 QString owner() const; |
76 QString owner() const; |
72 QString voicepack() const; |
77 QString voicepack() const; |
73 |
78 |
74 // attribute setters |
79 // attribute setters |
|
80 void bindKey(unsigned int idx, const QString & key); |
75 void setColor(const QColor & color); |
81 void setColor(const QColor & color); |
76 void setDifficulty(unsigned int level); |
82 void setDifficulty(unsigned int level); |
77 void setFlag(const QString & flag); |
83 void setFlag(const QString & flag); |
78 void setFort(const QString & fort); |
84 void setFort(const QString & fort); |
79 void setGrave(const QString & grave); |
85 void setGrave(const QString & grave); |
80 void setHedgehog(unsigned int idx, const HWHog & hh); |
86 void setHedgehog(unsigned int idx, HWHog hh); |
81 void setName(const QString & name); |
87 void setName(const QString & name); |
82 void setNumHedgehogs(unsigned char num); |
88 void setNumHedgehogs(unsigned char num); |
83 void setVoicepack(const QString & voicepack); |
89 void setVoicepack(const QString & voicepack); |
84 |
90 |
85 // increments for statistical info |
91 // increments for statistical info |
86 void incRounds(); |
92 void incRounds(); |
87 void incWins(); |
93 void incWins(); |
88 |
94 |
89 // pages... wait... wth is THIS doing in this class? FIXME!!!! |
|
90 void SetToPage(HWForm * hwform); |
|
91 void GetFromPage(HWForm * hwform); |
|
92 |
|
93 // convert team info into strings for further computation |
95 // convert team info into strings for further computation |
94 QStringList teamGameConfig(quint32 InitHealth) const; |
96 QStringList teamGameConfig(quint32 InitHealth) const; |
95 |
97 |
96 // comparison operators |
98 // comparison operators |
97 bool operator==(const HWTeam& t1) const; |
99 bool operator == (const HWTeam& t1) const; |
98 bool operator<(const HWTeam& t1) const; |
100 bool operator < (const HWTeam& t1) const; |
99 |
101 HWTeam & operator = (const HWTeam & other); |
100 |
102 |
101 |
103 |
102 private: |
104 private: |
103 |
105 |
104 QString OldTeamName; |
106 QString OldTeamName; |
108 QString m_grave; |
110 QString m_grave; |
109 QString m_fort; |
111 QString m_fort; |
110 QString m_flag; |
112 QString m_flag; |
111 QString m_voicepack; |
113 QString m_voicepack; |
112 HWHog m_hedgehogs[HEDGEHOGS_PER_TEAM]; |
114 HWHog m_hedgehogs[HEDGEHOGS_PER_TEAM]; |
113 unsigned int m_difficulty; |
115 quint8 m_difficulty; |
114 BindAction binds[BINDS_NUMBER]; |
116 BindAction m_binds[BINDS_NUMBER]; |
115 |
117 |
116 // class members that contain info for the current game setup |
118 // class members that contain info for the current game setup |
117 unsigned char m_numHedgehogs; |
119 quint8 m_numHedgehogs; |
118 QColor m_color; |
120 QColor m_color; |
119 bool m_isNetTeam; |
121 bool m_isNetTeam; |
120 QString m_owner; |
122 QString m_owner; |
121 |
123 |
122 // class members that contain statistics, etc. |
124 // class members that contain statistics, etc. |
123 unsigned int m_campaignProgress; |
125 unsigned int m_campaignProgress; |
124 unsigned int m_rounds; |
126 unsigned int m_rounds; |
125 unsigned int m_wins; |
127 unsigned int m_wins; |
126 unsigned int AchievementProgress[MAX_ACHIEVEMENTS]; |
128 unsigned int AchievementProgress[MAX_ACHIEVEMENTS]; |
127 |
|
128 |
|
129 }; |
129 }; |
130 |
130 |
131 #endif |
131 #endif |