mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-27 16:32:20 -07:00
[Client] Add tournament event plumbing and player extension points
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
This commit is contained in:
parent
4584891cf1
commit
43b6bcc1da
6 changed files with 75 additions and 6 deletions
|
|
@ -37,6 +37,19 @@ PlayerLogic::PlayerLogic(const ServerInfo_User &info, int _id, bool _local, bool
|
|||
initializeZones();
|
||||
}
|
||||
|
||||
PlayerLogic::PlayerLogic(const ServerInfo_User &info,
|
||||
int _id,
|
||||
bool _local,
|
||||
bool _judge,
|
||||
AbstractGame *_parent,
|
||||
PlayerEventHandler *customEventHandler)
|
||||
: QObject(_parent), game(_parent), playerInfo(new PlayerInfo(info, _id, _local, _judge)),
|
||||
playerEventHandler(customEventHandler), playerActions(new PlayerActions(this)), active(false), conceded(false),
|
||||
zoneId(0), dialogSemaphore(false)
|
||||
{
|
||||
initializeZones();
|
||||
}
|
||||
|
||||
void PlayerLogic::initializeZones()
|
||||
{
|
||||
addZone(new PileZoneLogic(this, ZoneNames::DECK, false, true, false, this));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue