Cockatrice 2026-04-21-Development-2.11.0-beta.61
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
card_zone_algorithms.h
Go to the documentation of this file.
1#ifndef COCKATRICE_CARD_ZONE_ALGORITHMS_H
2#define COCKATRICE_CARD_ZONE_ALGORITHMS_H
3
5{
6
26template <typename CardList, typename CardType>
27void addCardToList(CardList &cards, CardType *card, int x, bool keepAnnotations)
28{
29 if (x < 0 || x >= cards.size()) {
30 x = static_cast<int>(cards.size());
31 }
32 cards.insert(x, card);
33
34 if (!cards.getContentsKnown()) {
35 card->setId(-1);
36 card->setCardRef({});
37 }
38
39 card->resetState(keepAnnotations);
40 card->setVisible(true);
41}
42
43} // namespace CardZoneAlgorithms
44
45#endif // COCKATRICE_CARD_ZONE_ALGORITHMS_H
Definition card_list.h:18
bool getContentsKnown() const
Definition card_list.h:45
Definition card_zone_algorithms.h:5
void addCardToList(CardList &cards, CardType *card, int x, bool keepAnnotations)
Definition card_zone_algorithms.h:27