QTfrontend/game.cpp
changeset 588 b2e61fc49e5d
parent 587 74db4115064a
child 593 1f5e66379a43
equal deleted inserted replaced
587:74db4115064a 588:b2e61fc49e5d
   113 	team2.numHedgehogs = 4;
   113 	team2.numHedgehogs = 4;
   114 	RawSendIPC(HWProto::addStringListToBuffer(teamscfg,
   114 	RawSendIPC(HWProto::addStringListToBuffer(teamscfg,
   115 			team2.TeamGameConfig(gamecfg->getInitHealth())));
   115 			team2.TeamGameConfig(gamecfg->getInitHealth())));
   116 }
   116 }
   117 
   117 
       
   118 void HWGame::SendTrainingConfig()
       
   119 {
       
   120 	QByteArray teamscfg;
       
   121 	HWProto::addStringToBuffer(teamscfg, "TL");
       
   122 	HWProto::addStringToBuffer(teamscfg, "eseed none");
       
   123 	HWProto::addStringToBuffer(teamscfg, "e$gmflags 0");
       
   124 	HWProto::addStringToBuffer(teamscfg, "e$turntime 60000");
       
   125 	HWProto::addStringToBuffer(teamscfg, "emap mushrooms");
       
   126 	HWProto::addStringToBuffer(teamscfg, "etheme avematan");
       
   127 
       
   128 	HWTeam team1(0);
       
   129 	team1.difficulty = 0;
       
   130 	team1.teamColor = QColor(65535);
       
   131 	team1.numHedgehogs = 4;
       
   132 	HWProto::addStringListToBuffer(teamscfg,
       
   133 			team1.TeamGameConfig(100));
       
   134 
       
   135 	HWTeam team2(2);
       
   136 	team2.difficulty = 4;
       
   137 	team2.teamColor = QColor(16776960);
       
   138 	team2.numHedgehogs = 4;
       
   139 	RawSendIPC(HWProto::addStringListToBuffer(teamscfg,
       
   140 			team2.TeamGameConfig(100)));
       
   141 }
       
   142 
   118 void HWGame::SendNetConfig()
   143 void HWGame::SendNetConfig()
   119 {
   144 {
   120 	commonConfig();
   145 	commonConfig();
   121 }
   146 }
   122 
   147 
   138 					break;
   163 					break;
   139 				}
   164 				}
   140 				case gtDemo: break;
   165 				case gtDemo: break;
   141 				case gtNet: {
   166 				case gtNet: {
   142 					SendNetConfig();
   167 					SendNetConfig();
       
   168 					break;
       
   169 				}
       
   170 				case gtTraining: {
       
   171 				 	SendTrainingConfig();
   143 					break;
   172 					break;
   144 				}
   173 				}
   145 			}
   174 			}
   146 			break;
   175 			break;
   147 		}
   176 		}
   280 	SetGameState(gsStarted);
   309 	SetGameState(gsStarted);
   281 }
   310 }
   282 
   311 
   283 void HWGame::StartTraining()
   312 void HWGame::StartTraining()
   284 {
   313 {
   285 
   314 	gameType = gtTraining;
       
   315 	seed = "training";
       
   316 	demo.clear();
       
   317 	Start();
       
   318 	SetGameState(gsStarted);
   286 }
   319 }
   287 
   320 
   288 void HWGame::SetGameState(GameState state)
   321 void HWGame::SetGameState(GameState state)
   289 {
   322 {
   290 	gameState = state;
   323 	gameState = state;