mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 21:10:01 -08:00
[Game] Inject settings providers into libcockatrice_game, drop Widgets
This commit is contained in:
parent
db3caf4c5d
commit
31ce200ba0
35 changed files with 199 additions and 84 deletions
|
|
@ -12,9 +12,12 @@
|
|||
PlayerManager::PlayerManager(AbstractGame *_game,
|
||||
int _localPlayerId,
|
||||
bool _localPlayerIsJudge,
|
||||
bool localPlayerIsSpectator)
|
||||
bool localPlayerIsSpectator,
|
||||
IInterfaceSettingsProvider *_interfaceSettings,
|
||||
ICardPreferenceProvider *_cardPreferences)
|
||||
: QObject(_game), game(_game), players(QMap<int, PlayerLogic *>()), localPlayerId(_localPlayerId),
|
||||
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator)
|
||||
localPlayerIsJudge(_localPlayerIsJudge), localPlayerIsSpectator(localPlayerIsSpectator),
|
||||
interfaceSettings(_interfaceSettings), cardPreferences(_cardPreferences)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -52,7 +55,7 @@ bool PlayerManager::isLocalPlayer(int playerId)
|
|||
PlayerLogic *PlayerManager::addPlayer(int playerId, const ServerInfo_User &info)
|
||||
{
|
||||
auto *newPlayer = new PlayerLogic(info, playerId, isLocalPlayer(playerId) || game->getGameState()->getIsLocalGame(),
|
||||
isJudge(), getGame());
|
||||
isJudge(), getGame(), interfaceSettings, cardPreferences);
|
||||
connect(newPlayer, &PlayerLogic::concededChanged, this, &PlayerManager::onPlayerConceded);
|
||||
players.insert(playerId, newPlayer);
|
||||
emit playerAdded(newPlayer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue