Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
arrow_registry.h
Go to the documentation of this file.
1#ifndef COCKATRICE_ARROW_REGISTRY_H
2#define COCKATRICE_ARROW_REGISTRY_H
3
4#include <QList>
5#include <QMap>
6#include <QSet>
7
8class ArrowItem;
9struct ArrowData;
10template <class T> class QSharedPointer;
11
13{
16
17 bool operator<(const ArrowKey &other) const
18 {
19 if (creatorId != other.creatorId) {
20 return creatorId < other.creatorId;
21 }
22 return arrowId < other.arrowId;
23 }
24};
25
27{
28public:
30 ArrowItem *take(int creatorId, int arrowId);
31
32 [[nodiscard]] ArrowItem *get(int creatorId, int arrowId) const;
33 [[nodiscard]] bool contains(int creatorId, int arrowId) const;
34 [[nodiscard]] QSet<int> idsForPlayer(int playerId) const;
35 [[nodiscard]] QList<ArrowItem *> all() const;
36
37private:
41};
42
43#endif
Definition arrow_item.h:28
Definition arrow_registry.h:27
QMap< ArrowKey, QSharedPointer< ArrowData > > dataStore
Definition arrow_registry.h:38
QMap< int, QSet< int > > byPlayer
Definition arrow_registry.h:40
QSet< int > idsForPlayer(int playerId) const
Definition arrow_registry.cpp:43
QList< ArrowItem * > all() const
Definition arrow_registry.cpp:48
QMap< ArrowKey, ArrowItem * > items
Definition arrow_registry.h:39
ArrowItem * get(int creatorId, int arrowId) const
Definition arrow_registry.cpp:33
void insert(QSharedPointer< ArrowData > data, ArrowItem *arrow)
Definition arrow_registry.cpp:8
bool contains(int creatorId, int arrowId) const
Definition arrow_registry.cpp:38
ArrowItem * take(int creatorId, int arrowId)
Definition arrow_registry.cpp:21
Definition remote_connection_controller.h:20
Definition game.h:18
Definition dlg_manage_sets.h:29
Definition arrow_registry.h:10
Definition arrow_data.h:10
Definition arrow_registry.h:13
bool operator<(const ArrowKey &other) const
Definition arrow_registry.h:17
int arrowId
Definition arrow_registry.h:15
int creatorId
Definition arrow_registry.h:14