mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
removed the need to refresh the game list
This commit is contained in:
parent
197bf0dc64
commit
c00027f988
21 changed files with 211 additions and 215 deletions
|
|
@ -27,32 +27,37 @@ class ServerSocket;
|
|||
class ServerGame : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
ServerSocket *creator;
|
||||
QList<ServerSocket *> players;
|
||||
bool gameStarted;
|
||||
int activePlayer;
|
||||
int activePhase;
|
||||
int gameId;
|
||||
QString description;
|
||||
QString password;
|
||||
int maxPlayers;
|
||||
int activePlayer, activePhase;
|
||||
signals:
|
||||
void gameClosing();
|
||||
public slots:
|
||||
void broadcastEvent(const QString &event, ServerSocket *player);
|
||||
public:
|
||||
ServerSocket *creator;
|
||||
int gameId;
|
||||
QString description;
|
||||
QString password;
|
||||
int maxPlayers;
|
||||
ServerGame(ServerSocket *_creator, int _gameId, QString _description, QString _password, int _maxPlayers, QObject *parent = 0);
|
||||
ServerGame(ServerSocket *_creator, int _gameId, const QString &_description, const QString &_password, int _maxPlayers, QObject *parent = 0);
|
||||
~ServerGame();
|
||||
bool getGameStarted();
|
||||
int getPlayerCount();
|
||||
QStringList getPlayerNames();
|
||||
ServerSocket *getCreator() const { return creator; }
|
||||
bool getGameStarted() const { return gameStarted; }
|
||||
int getPlayerCount() const { return players.size(); }
|
||||
int getGameId() const { return gameId; }
|
||||
QString getDescription() const { return description; }
|
||||
QString getPassword() const { return password; }
|
||||
int getMaxPlayers() const { return maxPlayers; }
|
||||
QString getGameListLine() const;
|
||||
QStringList getPlayerNames() const;
|
||||
ServerSocket *getPlayer(int player_id);
|
||||
void addPlayer(ServerSocket *player);
|
||||
void removePlayer(ServerSocket *player);
|
||||
void startGameIfReady();
|
||||
void msg(const QString &s);
|
||||
int getActivePlayer() { return activePlayer; }
|
||||
int getActivePhase() { return activePhase; }
|
||||
int getActivePlayer() const { return activePlayer; }
|
||||
int getActivePhase() const { return activePhase; }
|
||||
void setActivePlayer(int _activePlayer);
|
||||
void setActivePhase(int _activePhase);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue