mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-12 04:50:01 -08:00
[Client] Drop dead player event handler extension points
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.
This commit is contained in:
parent
5add13a9c4
commit
e003ac0a45
5 changed files with 9 additions and 49 deletions
|
|
@ -93,10 +93,10 @@ public:
|
|||
* @param context Additional context (undo, judge, etc.).
|
||||
* @param options Processing options (UI suppression, reveal behavior).
|
||||
*/
|
||||
virtual void processGameEvent(GameEvent::GameEventType type,
|
||||
const GameEvent &event,
|
||||
const GameEventContext &context,
|
||||
EventProcessingOptions options);
|
||||
void processGameEvent(GameEvent::GameEventType type,
|
||||
const GameEvent &event,
|
||||
const GameEventContext &context,
|
||||
EventProcessingOptions options);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
@ -277,7 +277,7 @@ signals:
|
|||
*/
|
||||
void cardViewRefreshRequested(CardState *card, bool zoneChanged, PlayerLogic *newOwner);
|
||||
|
||||
protected:
|
||||
private:
|
||||
/** Owning player instance. */
|
||||
PlayerLogic *player;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue