equal
deleted
inserted
replaced
33 HWTeam::HWTeam(const QString & teamname) : |
33 HWTeam::HWTeam(const QString & teamname) : |
34 QObject(0) |
34 QObject(0) |
35 , m_difficulty(0) |
35 , m_difficulty(0) |
36 , m_numHedgehogs(4) |
36 , m_numHedgehogs(4) |
37 , m_isNetTeam(false) |
37 , m_isNetTeam(false) |
|
38 , m_isMissionTeam(false) |
38 { |
39 { |
39 m_name = teamname; |
40 m_name = teamname; |
40 OldTeamName = m_name; |
41 OldTeamName = m_name; |
41 for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
42 for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
42 { |
43 { |
59 |
60 |
60 HWTeam::HWTeam(const QStringList& strLst) : |
61 HWTeam::HWTeam(const QStringList& strLst) : |
61 QObject(0) |
62 QObject(0) |
62 , m_numHedgehogs(4) |
63 , m_numHedgehogs(4) |
63 , m_isNetTeam(true) |
64 , m_isNetTeam(true) |
|
65 , m_isMissionTeam(false) |
64 { |
66 { |
65 // net teams are configured from QStringList |
67 // net teams are configured from QStringList |
66 if(strLst.size() != 23) throw HWTeamConstructException(); |
68 if(strLst.size() != 23) throw HWTeamConstructException(); |
67 m_name = strLst[0]; |
69 m_name = strLst[0]; |
68 m_grave = strLst[1]; |
70 m_grave = strLst[1]; |
86 HWTeam::HWTeam() : |
88 HWTeam::HWTeam() : |
87 QObject(0) |
89 QObject(0) |
88 , m_difficulty(0) |
90 , m_difficulty(0) |
89 , m_numHedgehogs(4) |
91 , m_numHedgehogs(4) |
90 , m_isNetTeam(false) |
92 , m_isNetTeam(false) |
|
93 , m_isMissionTeam(false) |
91 { |
94 { |
92 m_name = QString("Team"); |
95 m_name = QString("Team"); |
93 for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
96 for (int i = 0; i < HEDGEHOGS_PER_TEAM; i++) |
94 { |
97 { |
95 m_hedgehogs.append(HWHog()); |
98 m_hedgehogs.append(HWHog()); |
123 , m_difficulty(other.m_difficulty) |
126 , m_difficulty(other.m_difficulty) |
124 , m_binds(other.m_binds) |
127 , m_binds(other.m_binds) |
125 , m_numHedgehogs(other.m_numHedgehogs) |
128 , m_numHedgehogs(other.m_numHedgehogs) |
126 , m_color(other.m_color) |
129 , m_color(other.m_color) |
127 , m_isNetTeam(other.m_isNetTeam) |
130 , m_isNetTeam(other.m_isNetTeam) |
|
131 , m_isMissionTeam(other.m_isMissionTeam) |
128 , m_owner(other.m_owner) |
132 , m_owner(other.m_owner) |
129 // , AchievementProgress(other.AchievementProgress) |
133 // , AchievementProgress(other.AchievementProgress) |
130 { |
134 { |
131 |
135 |
132 } |
136 } |
147 m_numHedgehogs = other.m_numHedgehogs; |
151 m_numHedgehogs = other.m_numHedgehogs; |
148 m_color = other.m_color; |
152 m_color = other.m_color; |
149 m_isNetTeam = other.m_isNetTeam; |
153 m_isNetTeam = other.m_isNetTeam; |
150 m_owner = other.m_owner; |
154 m_owner = other.m_owner; |
151 m_color = other.m_color; |
155 m_color = other.m_color; |
|
156 m_isMissionTeam = other.m_isMissionTeam; |
152 } |
157 } |
153 |
158 |
154 return *this; |
159 return *this; |
155 } |
160 } |
156 |
161 |
241 } |
246 } |
242 |
247 |
243 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const |
248 QStringList HWTeam::teamGameConfig(quint32 InitHealth) const |
244 { |
249 { |
245 QStringList sl; |
250 QStringList sl; |
|
251 QString cmdAddHog = "eaddhh"; |
|
252 |
246 if (m_isNetTeam) |
253 if (m_isNetTeam) |
247 { |
254 { |
248 sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toUtf8(), QCryptographicHash::Md5).toHex()))); |
255 sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(QString(QCryptographicHash::hash(m_owner.toUtf8(), QCryptographicHash::Md5).toHex()))); |
249 sl.push_back("erdriven"); |
256 sl.push_back("erdriven"); |
250 } |
257 } |
251 else sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash)); |
258 else |
|
259 { |
|
260 if (m_isMissionTeam) |
|
261 { |
|
262 sl.push_back(QString("esetmissteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash)); |
|
263 cmdAddHog = "eaddmisshh"; |
|
264 } |
|
265 else |
|
266 { |
|
267 sl.push_back(QString("eaddteam %3 %1 %2").arg(qcolor().rgb() & 0xffffff).arg(m_name).arg(playerHash)); |
|
268 } |
|
269 } |
252 |
270 |
253 sl.push_back(QString("egrave " + m_grave)); |
271 sl.push_back(QString("egrave " + m_grave)); |
254 sl.push_back(QString("efort " + m_fort)); |
272 sl.push_back(QString("efort " + m_fort)); |
255 sl.push_back(QString("evoicepack " + m_voicepack)); |
273 sl.push_back(QString("evoicepack " + m_voicepack)); |
256 sl.push_back(QString("eflag " + m_flag)); |
274 sl.push_back(QString("eflag " + m_flag)); |
258 if(!m_owner.isEmpty()) |
276 if(!m_owner.isEmpty()) |
259 sl.push_back(QString("eowner ") + m_owner); |
277 sl.push_back(QString("eowner ") + m_owner); |
260 |
278 |
261 for (int t = 0; t < m_numHedgehogs; t++) |
279 for (int t = 0; t < m_numHedgehogs; t++) |
262 { |
280 { |
263 sl.push_back(QString("eaddhh %1 %2 %3") |
281 sl.push_back(QString(cmdAddHog + " %1 %2 %3") |
264 .arg(QString::number(m_difficulty), |
282 .arg(QString::number(m_difficulty), |
265 QString::number(InitHealth), |
283 QString::number(InitHealth), |
266 m_hedgehogs[t].Name)); |
284 m_hedgehogs[t].Name)); |
267 sl.push_back(QString("ehat %1") |
285 sl.push_back(QString("ehat %1") |
268 .arg(m_hedgehogs[t].Hat)); |
286 .arg(m_hedgehogs[t].Hat)); |
279 bool HWTeam::isNetTeam() const |
297 bool HWTeam::isNetTeam() const |
280 { |
298 { |
281 return m_isNetTeam; |
299 return m_isNetTeam; |
282 } |
300 } |
283 |
301 |
|
302 void HWTeam::setMissionTeam(bool isMissionTeam) |
|
303 { |
|
304 m_isMissionTeam = isMissionTeam; |
|
305 } |
|
306 |
|
307 bool HWTeam::isMissionTeam() const |
|
308 { |
|
309 return m_isMissionTeam; |
|
310 } |
284 |
311 |
285 bool HWTeam::operator==(const HWTeam& t1) const |
312 bool HWTeam::operator==(const HWTeam& t1) const |
286 { |
313 { |
287 return m_name==t1.m_name; |
314 return m_name==t1.m_name; |
288 } |
315 } |