mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Revealing a library to a player now grants that player permission to drag cards out of that library onto his own table. This permission is revoked by shuffling the library. The zone view window tracks content changes of the zone for as long as the permission lasts so that card ID changes are kept track of. This hopefully fixes issues #5 and #12.
This commit is contained in:
parent
2ce18a82f5
commit
adbb607700
30 changed files with 231 additions and 101 deletions
|
|
@ -43,6 +43,8 @@ void Server_CardZone::shuffle()
|
|||
for (int i = cards.size(); i; i--)
|
||||
temp.append(cards.takeAt(rng->getNumber(0, i - 1)));
|
||||
cards = temp;
|
||||
|
||||
playersWithWritePermission.clear();
|
||||
}
|
||||
|
||||
int Server_CardZone::removeCard(Server_Card *card)
|
||||
|
|
@ -206,4 +208,10 @@ void Server_CardZone::clear()
|
|||
for (int i = 0; i < cards.size(); i++)
|
||||
delete cards.at(i);
|
||||
cards.clear();
|
||||
playersWithWritePermission.clear();
|
||||
}
|
||||
|
||||
void Server_CardZone::addWritePermission(int playerId)
|
||||
{
|
||||
playersWithWritePermission.insert(playerId);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue