equal
deleted
inserted
replaced
29 #include <QStringList> |
29 #include <QStringList> |
30 #include <QDebug> |
30 #include <QDebug> |
31 |
31 |
32 HWTeam::HWTeam(const QString & teamname, unsigned int netID) : |
32 HWTeam::HWTeam(const QString & teamname, unsigned int netID) : |
33 difficulty(0), |
33 difficulty(0), |
|
34 numHedgehogs(4), |
34 m_netID(netID) |
35 m_netID(netID) |
35 { |
36 { |
36 TeamName = teamname; |
37 TeamName = teamname; |
37 OldTeamName = TeamName; |
38 OldTeamName = TeamName; |
38 for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i); |
39 for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i); |
43 binds[i].action = cbinds[i].action; |
44 binds[i].action = cbinds[i].action; |
44 binds[i].strbind = cbinds[i].strbind; |
45 binds[i].strbind = cbinds[i].strbind; |
45 } |
46 } |
46 } |
47 } |
47 |
48 |
48 HWTeam::HWTeam(const QStringList& strLst) |
49 HWTeam::HWTeam(const QStringList& strLst) : |
|
50 numHedgehogs(4) |
49 { |
51 { |
50 // net teams are configured from QStringList |
52 // net teams are configured from QStringList |
51 if(strLst.size()<10) throw HWTeamConstructException(); |
53 if(strLst.size()<10) throw HWTeamConstructException(); |
52 TeamName=strLst[0]; |
54 TeamName=strLst[0]; |
53 m_netID=strLst[1].toUInt(); |
55 m_netID=strLst[1].toUInt(); |
54 for(int i = 0; i < 8; i++) HHName[i]=strLst[i+2]; |
56 for(int i = 0; i < 8; i++) HHName[i]=strLst[i+2]; |
55 } |
57 } |
56 |
58 |
57 HWTeam::HWTeam(quint8 num) : |
59 HWTeam::HWTeam(quint8 num) : |
58 difficulty(0), |
60 difficulty(0), |
|
61 numHedgehogs(4), |
59 m_netID(0) |
62 m_netID(0) |
60 { |
63 { |
61 num %= PREDEFTEAMS_COUNT; |
64 num %= PREDEFTEAMS_COUNT; |
62 TeamName = QApplication::translate("teams", pteams[num].TeamName); |
65 TeamName = QApplication::translate("teams", pteams[num].TeamName); |
63 HHName[0] = QApplication::translate("teams", pteams[num].hh0name); |
66 HHName[0] = QApplication::translate("teams", pteams[num].hh0name); |
78 } |
81 } |
79 |
82 |
80 |
83 |
81 bool HWTeam::LoadFromFile() |
84 bool HWTeam::LoadFromFile() |
82 { |
85 { |
|
86 numHedgehogs=4; |
83 QFile cfgfile(cfgdir->absolutePath() + "/" + TeamName + ".cfg"); |
87 QFile cfgfile(cfgdir->absolutePath() + "/" + TeamName + ".cfg"); |
84 if (!cfgfile.open(QIODevice::ReadOnly)) return false; |
88 if (!cfgfile.open(QIODevice::ReadOnly)) return false; |
85 QTextStream stream(&cfgfile); |
89 QTextStream stream(&cfgfile); |
86 stream.setCodec("UTF-8"); |
90 stream.setCodec("UTF-8"); |
87 QString str; |
91 QString str; |