Initial commit for sideboarding. It's supposed to be fully functional.

This commit is contained in:
Max-Wilhelm Bruker
2010-03-06 17:17:54 +01:00
parent 2ee4bb834d
commit b2f83541e7
18 changed files with 474 additions and 87 deletions

View File

@@ -85,6 +85,7 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
switch (command->getItemId()) {
case ItemId_Command_DeckSelect: return cmdDeckSelect(qobject_cast<Command_DeckSelect *>(command), cont, game, player);
case ItemId_Command_SetSideboardPlan: return cmdSetSideboardPlan(qobject_cast<Command_SetSideboardPlan *>(command), cont, game, player);
case ItemId_Command_LeaveGame: return cmdLeaveGame(qobject_cast<Command_LeaveGame *>(command), cont, game, player);
case ItemId_Command_ReadyStart: return cmdReadyStart(qobject_cast<Command_ReadyStart *>(command), cont, game, player);
case ItemId_Command_Concede: return cmdConcede(qobject_cast<Command_Concede *>(command), cont, game, player);
@@ -351,6 +352,16 @@ ResponseCode Server_ProtocolHandler::cmdDeckSelect(Command_DeckSelect *cmd, Comm
return RespNothing;
}
ResponseCode Server_ProtocolHandler::cmdSetSideboardPlan(Command_SetSideboardPlan *cmd, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
DeckList *deck = player->getDeck();
if (!deck)
return RespContextError;
deck->setCurrentSideboardPlan(cmd->getMoveList());
return RespOk;
}
ResponseCode Server_ProtocolHandler::cmdConcede(Command_Concede * /*cmd*/, CommandContainer *cont, Server_Game *game, Server_Player *player)
{
player->setConceded(true);