-
Notifications
You must be signed in to change notification settings - Fork 1
/
CardData.h
125 lines (102 loc) · 2.92 KB
/
CardData.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#ifndef __CardData_H__
#define __CardData_H__
#include <string>
#include <vector>
#define BoosterSize 15
#define BoosterCount 3
#define DeckSize 40
#define MinDeckLands 18
enum TCardColor
{
cGreen, cRed, cBlack, cBlue, cWhite, cColorless, cColorCount
};
TCardColor CharToColor(char c);
class TCardData
{
public:
enum TRarity { ryCommon, ryUncommon, ryRare };
private:
int Black;
int Blue;
int White;
int Green;
int Red;
int ConvertedManaCost;
public:
TCardData(string aName,
string aType,
string aSubTypes,
string aPowerToughness,
string aManaCost,
TRarity aRarity,
string aText,
string aEdition);
const string Name;
const string Type;
const string SubTypes;
const string ManaCost;
const string Text;
//const string PowerToughness;
string Power;
string Toughness;
const string Edition;
TRarity Rarity;
static const string Rarities[3];
int GetBlack() const { return Black; };
int GetBlue() const { return Blue; };
int GetWhite() const { return White; };
int GetGreen() const { return Green; };
int GetRed() const { return Red; };
int GetCost() const { return ConvertedManaCost; };
TCardColor GetColor() const;
};
typedef std::vector<TCardData*> TCardPile;
typedef std::vector<TCardData*>::iterator TCardBrowser;
typedef std::vector<TCardData*>::const_iterator TConstCardBrowser;
bool CompareCards(const TCardData* a, const TCardData* b);
bool operator == (const TCardData* a, const string b);
struct TCardComparator
{
bool operator () (const TCardData* c, const string Value) const;
typedef const TCardData* first_argument_type;
typedef const string second_argument_type;
typedef bool result_type;
private:
// ëàòàåì äûðû òåìïëåéòîâ CB
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareType : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareSubType : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareName : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct IncludeText : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct ComparePower : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareToughness : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareEdition : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
struct CompareCMC : public TCardComparator
{
virtual bool Is(const TCardData* c, const string Value) const;
};
TCardComparator& const ComparatorFactory(string Kind, bool& Success);
//void ComparatorRecycler(TCardComparator* c);
#endif