QTfrontend/game.cpp
changeset 681 7a20c50988ec
parent 673 bd82104a28af
child 682 a37b6966de84
equal deleted inserted replaced
680:8ef26c8e8aa7 681:7a20c50988ec
    21 #include <QTimer>
    21 #include <QTimer>
    22 #include <QString>
    22 #include <QString>
    23 #include <QByteArray>
    23 #include <QByteArray>
    24 #include <QFile>
    24 #include <QFile>
    25 #include <QTextStream>
    25 #include <QTextStream>
       
    26 #include <QApplication>
    26 
    27 
    27 #include "game.h"
    28 #include "game.h"
    28 #include "hwconsts.h"
    29 #include "hwconsts.h"
    29 #include "gameuiconfig.h"
    30 #include "gameuiconfig.h"
    30 #include "gamecfgwidget.h"
    31 #include "gamecfgwidget.h"
    31 #include "teamselect.h"
    32 #include "teamselect.h"
    32 #include "KB.h"
    33 #include "KB.h"
    33 #include "proto.h"
    34 #include "proto.h"
    34 
    35 
    35 HWGame::HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, TeamSelWidget* pTeamSelWidget) :
    36 HWGame::HWGame(GameUIConfig * config, GameCFGWidget * gamecfg, QString ammo, TeamSelWidget* pTeamSelWidget) :
    36   TCPBase(true),
    37   TCPBase(true),
    37   m_pTeamSelWidget(pTeamSelWidget)
    38   m_pTeamSelWidget(pTeamSelWidget),
       
    39   ammostr(ammo)
    38 {
    40 {
    39 	this->config = config;
    41 	this->config = config;
    40 	this->gamecfg = gamecfg;
    42 	this->gamecfg = gamecfg;
    41 	TeamCount = 0;
    43 	TeamCount = 0;
    42 	seed = "";
    44 	seed = "";
    81 		QList<HWTeam> teams = m_pTeamSelWidget->getPlayingTeams();
    83 		QList<HWTeam> teams = m_pTeamSelWidget->getPlayingTeams();
    82 		for(QList<HWTeam>::iterator it = teams.begin(); it != teams.end(); ++it)
    84 		for(QList<HWTeam>::iterator it = teams.begin(); it != teams.end(); ++it)
    83 		{
    85 		{
    84 			HWProto::addStringListToBuffer(buf,
    86 			HWProto::addStringListToBuffer(buf,
    85 				(*it).TeamGameConfig(gamecfg->getInitHealth()));
    87 				(*it).TeamGameConfig(gamecfg->getInitHealth()));
    86 			HWProto::addStringToBuffer(buf, *cDefaultAmmoStore);
    88 			HWProto::addStringToBuffer(buf, ammostr);
    87 		}
    89 		}
    88 	}
    90 	}
    89 	RawSendIPC(buf);
    91 	RawSendIPC(buf);
    90 }
    92 }
    91 
    93