mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
implemented game types
This commit is contained in:
parent
7116382a96
commit
04742f6fb9
23 changed files with 249 additions and 127 deletions
|
|
@ -23,6 +23,7 @@ class MoveCardToZone;
|
|||
enum ItemId {
|
||||
ItemId_CommandContainer = ItemId_Other + 50,
|
||||
ItemId_GameEventContainer = ItemId_Other + 51,
|
||||
ItemId_Command_CreateGame = ItemId_Other + 99,
|
||||
ItemId_Command_DeckUpload = ItemId_Other + 100,
|
||||
ItemId_Command_DeckSelect = ItemId_Other + 101,
|
||||
ItemId_Command_SetSideboardPlan = ItemId_Other + 102,
|
||||
|
|
@ -173,6 +174,22 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class Command_CreateGame : public RoomCommand {
|
||||
Q_OBJECT
|
||||
public:
|
||||
Command_CreateGame(int _roomId = -1, const QString &_description = QString(), const QString &_password = QString(), int _maxPlayers = -1, const QList<GameTypeId *> &_gameTypes = QList<GameTypeId *>(), bool _spectatorsAllowed = false, bool _spectatorsNeedPassword = false, bool _spectatorsCanTalk = false, bool _spectatorsSeeEverything = false);
|
||||
QString getDescription() const { return static_cast<SerializableItem_String *>(itemMap.value("description"))->getData(); };
|
||||
QString getPassword() const { return static_cast<SerializableItem_String *>(itemMap.value("password"))->getData(); };
|
||||
int getMaxPlayers() const { return static_cast<SerializableItem_Int *>(itemMap.value("max_players"))->getData(); };
|
||||
bool getSpectatorsAllowed() const { return static_cast<SerializableItem_Bool *>(itemMap.value("spectators_allowed"))->getData(); };
|
||||
bool getSpectatorsNeedPassword() const { return static_cast<SerializableItem_Bool *>(itemMap.value("spectators_need_password"))->getData(); };
|
||||
bool getSpectatorsCanTalk() const { return static_cast<SerializableItem_Bool *>(itemMap.value("spectators_can_talk"))->getData(); };
|
||||
bool getSpectatorsSeeEverything() const { return static_cast<SerializableItem_Bool *>(itemMap.value("spectators_see_everything"))->getData(); };
|
||||
QList<GameTypeId *> getGameTypes() const { return typecastItemList<GameTypeId *>(); }
|
||||
static SerializableItem *newItem() { return new Command_CreateGame; }
|
||||
int getItemId() const { return ItemId_Command_CreateGame; }
|
||||
};
|
||||
|
||||
class Command_DeckUpload : public Command {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue