Cockatrice
2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Toggle main menu visibility
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
4
namespace
CardZoneAlgorithms
5
{
6
26
template
<
typename
CardList,
typename
CardType>
27
void
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
CardList
Definition
card_list.h:20
CardList::getContentsKnown
bool getContentsKnown() const
Definition
card_list.h:47
CardZoneAlgorithms
Definition
card_zone_algorithms.h:5
CardZoneAlgorithms::addCardToList
void addCardToList(CardList &cards, CardType *card, int x, bool keepAnnotations)
Definition
card_zone_algorithms.h:27
cockatrice
src
game
zones
card_zone_algorithms.h
Generated by
1.18.0