forked from Fluorohydride/ygopro-core
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgroup.h
44 lines (35 loc) · 781 Bytes
/
group.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* group.h
*
* Created on: 2010-5-6
* Author: Argon
*/
#ifndef GROUP_H_
#define GROUP_H_
#include "common.h"
#include "sort.h"
#include <set>
#include <list>
class card;
class duel;
using card_set = std::set<card*, card_sort>;
constexpr uint32_t GTYPE_DEFAULT = 0;
constexpr uint32_t GTYPE_READ_ONLY = 1;
constexpr uint32_t GTYPE_KEEP_ALIVE = 2;
class alignas(8) group {
public:
int32_t ref_handle{ 0 };
uint32_t is_readonly{ GTYPE_DEFAULT };
duel* pduel;
card_set container;
card_set::iterator it;
bool is_iterator_dirty{ true };
bool has_card(card* c) {
return container.find(c) != container.end();
}
explicit group(duel* pd);
group(duel* pd, card* pcard);
group(duel* pd, const card_set& cset);
~group() = default;
};
#endif /* GROUP_H_ */