mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
create participant, move code
This commit is contained in:
parent
74bbef53b2
commit
74b5241544
11 changed files with 1084 additions and 669 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue