create participant, move code

This commit is contained in:
ebbit1q 2025-09-18 12:02:09 +02:00
parent 74bbef53b2
commit 74b5241544
11 changed files with 1084 additions and 669 deletions

View file

@ -318,7 +318,7 @@ void Server_CardZone::addWritePermission(int playerId)
playersWithWritePermission.insert(playerId);
}
void Server_CardZone::getInfo(ServerInfo_Zone *info, Server_Player *playerWhosAsking, bool omniscient)
void Server_CardZone::getInfo(ServerInfo_Zone *info, Server_AbstractParticipant *recipient, bool omniscient)
{
info->set_name(name.toStdString());
info->set_type(type);
@ -327,10 +327,10 @@ void Server_CardZone::getInfo(ServerInfo_Zone *info, Server_Player *playerWhosAs
info->set_always_reveal_top_card(alwaysRevealTopCard);
info->set_always_look_at_top_card(alwaysLookAtTopCard);
const auto selfPlayerAsking = playerWhosAsking == player || omniscient;
const auto zonesSelfCanSee = type != ServerInfo_Zone::HiddenZone;
const auto otherPlayerAsking = playerWhosAsking != player;
const auto zonesOthersCanSee = type == ServerInfo_Zone::PublicZone;
const bool selfPlayerAsking = recipient == player || omniscient;
const bool zonesSelfCanSee = type != ServerInfo_Zone::HiddenZone;
const bool otherPlayerAsking = recipient != player;
const bool zonesOthersCanSee = type == ServerInfo_Zone::PublicZone;
if ((selfPlayerAsking && zonesSelfCanSee) || (otherPlayerAsking && zonesOthersCanSee)) {
QListIterator<Server_Card *> cardIterator(cards);
while (cardIterator.hasNext())