mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 03:23:56 -07:00
event handling
This commit is contained in:
parent
e796af2b89
commit
77015c9ebf
34 changed files with 891 additions and 855 deletions
|
|
@ -14,16 +14,25 @@ class MessageLogWidget;
|
|||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QPushButton;
|
||||
class QMenu;
|
||||
class ZoneViewLayout;
|
||||
class ZoneViewWidget;
|
||||
class PhasesToolbar;
|
||||
class PlayerListWidget;
|
||||
class ProtocolResponse;
|
||||
class GameEvent;
|
||||
class GameCommand;
|
||||
class Event_GameStateChanged;
|
||||
class Event_GameStart;
|
||||
class Event_GameStateChanged;
|
||||
class Event_Join;
|
||||
class Event_Leave;
|
||||
class Event_GameClosed;
|
||||
class Event_GameStart;
|
||||
class Event_SetActivePlayer;
|
||||
class Event_SetActivePhase;
|
||||
class Player;
|
||||
class CardZone;
|
||||
class CardItem;
|
||||
|
||||
class TabGame : public QWidget {
|
||||
Q_OBJECT
|
||||
|
|
@ -39,6 +48,7 @@ private:
|
|||
|
||||
QPushButton *loadLocalButton, *loadRemoteButton, *readyStartButton;
|
||||
CardInfoWidget *cardInfo;
|
||||
PlayerListWidget *playerListWidget;
|
||||
MessageLogWidget *messageLog;
|
||||
QLabel *sayLabel;
|
||||
QLineEdit *sayEdit;
|
||||
|
|
@ -48,51 +58,42 @@ private:
|
|||
DeckView *deckView;
|
||||
QWidget *deckViewContainer;
|
||||
ZoneViewLayout *zoneLayout;
|
||||
QAction *aCloseMostRecentZoneView;
|
||||
QAction *aCloseMostRecentZoneView,
|
||||
*aNextPhase, *aNextTurn, *aRemoveLocalArrows;
|
||||
QMenu *gameMenu;
|
||||
|
||||
Player *addPlayer(int playerId, const QString &playerName);
|
||||
|
||||
void eventGameStateChanged(Event_GameStateChanged *event);
|
||||
void eventGameStart(Event_GameStart *event);
|
||||
void eventGameStateChanged(Event_GameStateChanged *event);
|
||||
void eventJoin(Event_Join *event);
|
||||
void eventLeave(Event_Leave *event);
|
||||
void eventGameClosed(Event_GameClosed *event);
|
||||
void eventSetActivePlayer(Event_SetActivePlayer *event);
|
||||
void eventSetActivePhase(Event_SetActivePhase *event);
|
||||
signals:
|
||||
// -- XXX --
|
||||
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);
|
||||
// -- XXX --
|
||||
private slots:
|
||||
void loadLocalDeck();
|
||||
void loadRemoteDeck();
|
||||
void readyStart();
|
||||
void deckSelectFinished(ProtocolResponse *r);
|
||||
void newCardAdded(CardItem *card);
|
||||
|
||||
void actRemoveLocalArrows();
|
||||
void actSay();
|
||||
void actNextPhase();
|
||||
void actNextTurn();
|
||||
public:
|
||||
TabGame(Client *_client, int _gameId, int _localPlayerId, bool _spectator);
|
||||
void retranslateUi();
|
||||
const QMap<int, Player *> &getPlayers() const { return players; }
|
||||
|
||||
void processGameEvent(GameEvent *event);
|
||||
public slots:
|
||||
void sendGameCommand(GameCommand *command);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue