mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Lint.
Took 10 minutes
This commit is contained in:
parent
595eb609ad
commit
70f29256fd
9 changed files with 22 additions and 13 deletions
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
#include "player/player.h"
|
#include "player/player.h"
|
||||||
|
|
||||||
AbstractGame::AbstractGame(TabGame *_tab)
|
AbstractGame::AbstractGame(TabGame *_tab) : tab(_tab)
|
||||||
: tab(_tab)
|
|
||||||
{
|
{
|
||||||
gameMetaInfo = new GameMetaInfo(this);
|
gameMetaInfo = new GameMetaInfo(this);
|
||||||
gameEventHandler = new GameEventHandler(this);
|
gameEventHandler = new GameEventHandler(this);
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,3 @@ Game::Game(TabGame *_tab,
|
||||||
playerManager = new PlayerManager(this, event.player_id(), event.judge(), event.spectator());
|
playerManager = new PlayerManager(this, event.player_id(), event.judge(), event.spectator());
|
||||||
gameMetaInfo->setStarted(false);
|
gameMetaInfo->setStarted(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#define COCKATRICE_GAME_H
|
#define COCKATRICE_GAME_H
|
||||||
|
|
||||||
#include "abstract_game.h"
|
#include "abstract_game.h"
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class Game : public AbstractGame
|
class Game : public AbstractGame
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "game_state.h"
|
#include "game_state.h"
|
||||||
|
|
||||||
#include "abstract_game.h"
|
#include "abstract_game.h"
|
||||||
|
|
||||||
GameState::GameState(AbstractGame *_game,
|
GameState::GameState(AbstractGame *_game,
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,10 @@ bool PlayerListTWI::operator<(const QTreeWidgetItem &other) const
|
||||||
return data(4, Qt::UserRole + 1).toInt() < other.data(4, Qt::UserRole + 1).toInt();
|
return data(4, Qt::UserRole + 1).toInt() < other.data(4, Qt::UserRole + 1).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, AbstractGame *_game, QWidget *parent)
|
PlayerListWidget::PlayerListWidget(TabSupervisor *_tabSupervisor,
|
||||||
|
AbstractClient *_client,
|
||||||
|
AbstractGame *_game,
|
||||||
|
QWidget *parent)
|
||||||
: QTreeWidget(parent), tabSupervisor(_tabSupervisor), client(_client), game(_game), gameStarted(false)
|
: QTreeWidget(parent), tabSupervisor(_tabSupervisor), client(_client), game(_game), gameStarted(false)
|
||||||
{
|
{
|
||||||
readyIcon = QPixmap("theme:icons/ready_start");
|
readyIcon = QPixmap("theme:icons/ready_start");
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,10 @@ signals:
|
||||||
void openMessageDialog(const QString &userName, bool focus);
|
void openMessageDialog(const QString &userName, bool focus);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PlayerListWidget(TabSupervisor *_tabSupervisor, AbstractClient *_client, AbstractGame *_game, QWidget *parent = nullptr);
|
PlayerListWidget(TabSupervisor *_tabSupervisor,
|
||||||
|
AbstractClient *_client,
|
||||||
|
AbstractGame *_game,
|
||||||
|
QWidget *parent = nullptr);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
void setActivePlayer(int playerId);
|
void setActivePlayer(int playerId);
|
||||||
void setGameStarted(bool _gameStarted, bool resuming);
|
void setGameStarted(bool _gameStarted, bool resuming);
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,10 @@
|
||||||
#include "../abstract_game.h"
|
#include "../abstract_game.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
|
|
||||||
PlayerManager::PlayerManager(AbstractGame *_game, int _localPlayerId, bool _localPlayerIsJudge, bool localPlayerIsSpectator)
|
PlayerManager::PlayerManager(AbstractGame *_game,
|
||||||
|
int _localPlayerId,
|
||||||
|
bool _localPlayerIsJudge,
|
||||||
|
bool localPlayerIsSpectator)
|
||||||
: QObject(_game), game(_game), players(QMap<int, Player *>()), localPlayerId(_localPlayerId),
|
: QObject(_game), game(_game), players(QMap<int, Player *>()), localPlayerId(_localPlayerId),
|
||||||
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator)
|
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
#include "../client/tabs/tab_game.h"
|
#include "../client/tabs/tab_game.h"
|
||||||
|
|
||||||
Replay::Replay(TabGame *_tab, GameReplay *_replay) : AbstractGame(_tab)
|
Replay::Replay(TabGame *_tab, GameReplay *_replay) : AbstractGame(_tab)
|
||||||
{
|
{
|
||||||
gameState = new GameState(this, 0, -1, tab->getTabSupervisor()->getIsLocalGame(), {}, false,
|
gameState = new GameState(this, 0, -1, tab->getTabSupervisor()->getIsLocalGame(), {}, false, false, -1, false);
|
||||||
false, -1, false);
|
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
||||||
connect(gameMetaInfo, &GameMetaInfo::startedChanged, gameState, &GameState::onStartedChanged);
|
playerManager = new PlayerManager(this, -1, false, true);
|
||||||
playerManager = new PlayerManager(this, -1, false, true);
|
loadReplay(_replay);
|
||||||
loadReplay(_replay);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
|
|
||||||
#include "abstract_game.h"
|
#include "abstract_game.h"
|
||||||
|
|
||||||
class Replay : public AbstractGame {
|
class Replay : public AbstractGame
|
||||||
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue