mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 08:14:47 -07:00
Server_CardZone::getFreeGridColumn() now runs in O(log n), which should remove the performance bottleneck when processing insertCard(x = -1) commands on a large zone, e.g. createToken
This commit is contained in:
parent
590ab2f598
commit
60a1f5d7d1
3 changed files with 76 additions and 34 deletions
|
|
@ -42,6 +42,10 @@ private:
|
|||
bool alwaysRevealTopCard;
|
||||
QList<Server_Card *> cards;
|
||||
QMap<int, QMap<int, Server_Card *> > coordinateMap; // y -> (x -> card)
|
||||
QMap<int, QMultiMap<QString, int> > freePilesMap; // y -> (cardName -> x)
|
||||
QMap<int, int> freeSpaceMap; // y -> x
|
||||
void removeCardFromCoordMap(Server_Card *card, int oldX, int oldY);
|
||||
void insertCardIntoCoordMap(Server_Card *card, int x, int y);
|
||||
public:
|
||||
Server_CardZone(Server_Player *_player, const QString &_name, bool _has_coords, ServerInfo_Zone::ZoneType _type);
|
||||
~Server_CardZone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue