QTfrontend/team.cpp
changeset 339 7535ab6c3820
parent 336 82d654db133d
child 341 184230eb4151
equal deleted inserted replaced
338:d1e75dcd285f 339:7535ab6c3820
    28 
    28 
    29 #include <QStringList>
    29 #include <QStringList>
    30 #include <QDebug>
    30 #include <QDebug>
    31 
    31 
    32 HWTeam::HWTeam(const QString & teamname) :
    32 HWTeam::HWTeam(const QString & teamname) :
    33   difficulty(0)
    33   difficulty(0),
       
    34   netTeam(false)
    34 {
    35 {
    35 	TeamName = teamname;
    36 	TeamName = teamname;
    36 	OldTeamName = TeamName;
    37 	OldTeamName = TeamName;
    37 	for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i);
    38 	for (int i = 0; i < 8; i++) HHName[i].sprintf("hedgehog %d", i);
    38 	Grave = "Simple";
    39 	Grave = "Simple";
    42 		binds[i].action = cbinds[i].action;
    43 		binds[i].action = cbinds[i].action;
    43 		binds[i].strbind = cbinds[i].strbind;
    44 		binds[i].strbind = cbinds[i].strbind;
    44 	}
    45 	}
    45 }
    46 }
    46 
    47 
    47 HWTeam::HWTeam(const QStringList& strLst)
    48 HWTeam::HWTeam(const QStringList& strLst) :
    48 {
    49   netTeam(true)
       
    50 {
       
    51   // net teams are configured from QStringList
    49   if(strLst.size()<9) throw HWTeamConstructException();
    52   if(strLst.size()<9) throw HWTeamConstructException();
    50   TeamName=strLst[0];
    53   TeamName=strLst[0];
    51   for(int i = 0; i < 8; i++) HHName[i]=strLst[i+1];
    54   for(int i = 0; i < 8; i++) HHName[i]=strLst[i+1];
    52 }
    55 }
    53 
    56 
    54 HWTeam::HWTeam(quint8 num) :
    57 HWTeam::HWTeam(quint8 num) :
    55   difficulty(0)
    58   difficulty(0),
       
    59   netTeam(false)
    56 {
    60 {
    57 	num %= PREDEFTEAMS_COUNT;
    61 	num %= PREDEFTEAMS_COUNT;
    58 	TeamName = QApplication::translate("teams", pteams[num].TeamName);
    62 	TeamName = QApplication::translate("teams", pteams[num].TeamName);
    59 	HHName[0] = QApplication::translate("teams", pteams[num].hh0name);
    63 	HHName[0] = QApplication::translate("teams", pteams[num].hh0name);
    60 	HHName[1] = QApplication::translate("teams", pteams[num].hh1name);
    64 	HHName[1] = QApplication::translate("teams", pteams[num].hh1name);