The second PlayerLogic constructor taking a custom PlayerEventHandler was UB
(converting this to PlayerLogic* in the base initializer, and connecting a
freshly-built handler against a not-yet-constructed object), and its abstract
extension surface — virtual initializeZones, virtual getPlayerEventHandler,
virtual processGameEvent, protected player member — has no subclass consumer in
the stack. Revert to the single primary constructor.
Also:
- Drop the unused GameMetaInfo::setIsTournament setter. Tournament status is
authoritative from Event_GameJoined's ServerInfo_Game; the redundant
is_tournament field on Event_GameStateChanged is removed in [Protocol].
- Gate the parent-game routing on has_parent_game_id() instead of comparing the
proto default, so a future drop of the default keeps working.
Wires the client game layer for tournament state without touching
existing behavior:
- GameEventHandler dispatches Event_TournamentState (2027) to a new
tournamentStateChanged signal
- GameMetaInfo exposes isTournament and parentGameId over the new
ServerInfo_Game field
- PlayerEventHandler::processGameEvent is virtual and player is
protected; PlayerLogic gains a protected constructor accepting a
custom handler, so mode-specific subclasses can intercept events
* [Refactor] Move game logic into libcockatrice_game
* [Refactor] Include card_state.h in player_actions.h
* [Game] Inject settings providers into libcockatrice_game, drop Widgets
* [Game] Follow base rename to createCardRequested after rebase
* [Game] Drop unused CardItem forward declaration
* [Game] Fix includes after moving game logic into libcockatrice_game
---------
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-10-31 18:44:15 +01:00
Renamed from cockatrice/src/game/game_meta_info.h (Browse further)