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

@@ -14,6 +14,7 @@ void ProtocolItem::initializeHash()
{
initializeHashAuto();
registerSerializableItem("move_card_to_zone", MoveCardToZone::newItem);
registerSerializableItem("chat_channel", ServerInfo_ChatChannel::newItem);
registerSerializableItem("chat_user", ServerInfo_ChatUser::newItem);
registerSerializableItem("game", ServerInfo_Game::newItem);
@@ -32,6 +33,7 @@ void ProtocolItem::initializeHash()
registerSerializableItem("cmddeck_upload", Command_DeckUpload::newItem);
registerSerializableItem("cmddeck_select", Command_DeckSelect::newItem);
registerSerializableItem("cmdset_sideboard_plan", Command_SetSideboardPlan::newItem);
registerSerializableItem("resp", ProtocolResponse::newItem);
ProtocolResponse::initializeHash();
@@ -170,6 +172,18 @@ DeckList *Command_DeckSelect::getDeck() const
return static_cast<DeckList *>(itemMap.value("cockatrice_deck"));
}
Command_SetSideboardPlan::Command_SetSideboardPlan(int _gameId, const QList<MoveCardToZone *> &_moveList)
: GameCommand("set_sideboard_plan", _gameId)
{
for (int i = 0; i < _moveList.size(); ++i)
itemList.append(_moveList[i]);
}
QList<MoveCardToZone *> Command_SetSideboardPlan::getMoveList() const
{
return typecastItemList<MoveCardToZone *>();
}
QHash<QString, ResponseCode> ProtocolResponse::responseHash;
ProtocolResponse::ProtocolResponse(int _cmdId, ResponseCode _responseCode, const QString &_itemName)