[Game] Inject settings providers into libcockatrice_game, drop Widgets

This commit is contained in:
Lukas Brübach 2026-10-11 15:11:54 +02:00 • committed by GitHub
parent db3caf4c5d
commit 31ce200ba0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 199 additions and 84 deletions

View file

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