removed the need to refresh the game list

This commit is contained in:
Max-Wilhelm Bruker 2009-06-11 17:51:52 +02:00
parent 197bf0dc64
commit c00027f988
21 changed files with 211 additions and 215 deletions

View file

@ -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);
};