mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-01 19:13:55 -07:00
new code
This commit is contained in:
parent
6c93b1e9b7
commit
0d4717f40b
28 changed files with 591 additions and 375 deletions
|
|
@ -2,14 +2,13 @@
|
|||
#define TAB_GAME_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
|
||||
class Client;
|
||||
class CardDatabase;
|
||||
class GameEvent;
|
||||
class GameView;
|
||||
class DeckView;
|
||||
class GameScene;
|
||||
class Game;
|
||||
class CardInfoWidget;
|
||||
class MessageLogWidget;
|
||||
class QLabel;
|
||||
|
|
@ -19,12 +18,23 @@ class ZoneViewLayout;
|
|||
class ZoneViewWidget;
|
||||
class PhasesToolbar;
|
||||
class ProtocolResponse;
|
||||
class GameEvent;
|
||||
class Event_GameJoined;
|
||||
class Event_GameStart;
|
||||
class Player;
|
||||
class CardZone;
|
||||
|
||||
class TabGame : public QWidget {
|
||||
Q_OBJECT
|
||||
private:
|
||||
Client *client;
|
||||
int gameId;
|
||||
int localPlayerId;
|
||||
bool spectator;
|
||||
QStringList spectatorList;
|
||||
QMap<int, Player *> players;
|
||||
bool started;
|
||||
int currentPhase;
|
||||
|
||||
QPushButton *loadLocalButton, *loadRemoteButton, *readyStartButton;
|
||||
CardInfoWidget *cardInfo;
|
||||
|
|
@ -35,9 +45,41 @@ private:
|
|||
GameScene *scene;
|
||||
GameView *gameView;
|
||||
DeckView *deckView;
|
||||
Game *game;
|
||||
QWidget *deckViewContainer;
|
||||
ZoneViewLayout *zoneLayout;
|
||||
QAction *aCloseMostRecentZoneView;
|
||||
|
||||
Player *addPlayer(int playerId, const QString &playerName);
|
||||
|
||||
void eventGameStart(Event_GameStart *event);
|
||||
signals:
|
||||
void playerAdded(Player *player);
|
||||
void playerRemoved(Player *player);
|
||||
|
||||
// Log events
|
||||
void logPlayerListReceived(QStringList players);
|
||||
void logJoin(Player *player);
|
||||
void logLeave(Player *player);
|
||||
void logGameClosed();
|
||||
void logJoinSpectator(QString playerName);
|
||||
void logLeaveSpectator(QString playerName);
|
||||
void logReadyStart(Player *player);
|
||||
void logGameStart();
|
||||
void logSay(Player *player, QString text);
|
||||
void logShuffle(Player *player);
|
||||
void logRollDie(Player *player, int sides, int roll);
|
||||
void logDraw(Player *player, int number);
|
||||
void logMoveCard(Player *player, QString cardName, CardZone *startZone, int oldX, CardZone *targetZone, int newX);
|
||||
void logCreateToken(Player *player, QString cardName);
|
||||
void logCreateArrow(Player *player, Player *startPlayer, QString startCard, Player *targetPlayer, QString targetCard);
|
||||
void logSetCardCounters(Player *player, QString cardName, int value, int oldValue);
|
||||
void logSetTapped(Player *player, QString cardName, bool tapped);
|
||||
void logSetCounter(Player *player, QString counterName, int value, int oldValue);
|
||||
void logSetDoesntUntap(Player *player, QString cardName, bool doesntUntap);
|
||||
void logDumpZone(Player *player, CardZone *zone, int numberCards);
|
||||
void logStopDumpZone(Player *player, CardZone *zone);
|
||||
void logSetActivePlayer(Player *player);
|
||||
void setActivePhase(int phase);
|
||||
private slots:
|
||||
void loadLocalDeck();
|
||||
void loadRemoteDeck();
|
||||
|
|
@ -46,7 +88,9 @@ private slots:
|
|||
public:
|
||||
TabGame(Client *_client, int _gameId);
|
||||
void retranslateUi();
|
||||
|
||||
void processGameEvent(GameEvent *event);
|
||||
void processGameJoinedEvent(Event_GameJoined *event);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue