-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommon.h
116 lines (105 loc) · 2.67 KB
/
Common.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
#ifndef COMMON_H
#define COMMON_H
#include <QString>
#include <algorithm>
#include <random>
#include <chrono>
typedef std::function<void()> CallBack;
//global control const
#define DECK_CARD_WIDTH 59
#define DECK_CARD_HEIGHT 86
#define RIGHT_FRAME_CARD_WIDTH 118
#define RIGHT_FRAME_CARD_HEIGHT 172
#define RIGHT_FRAME_MINMUM_HEIGHT 250
#define MAXNUM_DISPLAY_SEARCH_RESULT 50
#define DECK_FRAME_COLUMN 10
#define TAB2_DECK_COLUMN 6
#define TAB2_EDIT_DECK_COLUMN 7
#define TEST_TIME 100000
//types
#define TYPE_MONSTER 0x1
#define TYPE_SPELL 0x2
#define TYPE_TRAP 0x4
#define TYPE_NORMAL 0x10
#define TYPE_EFFECT 0x20
#define TYPE_FUSION 0x40
#define TYPE_RITUAL 0x80
#define TYPE_TRAPMONSTER 0x100
#define TYPE_SPIRIT 0x200
#define TYPE_UNION 0x400
#define TYPE_DUAL 0x800
#define TYPE_TUNER 0x1000
#define TYPE_SYNCHRO 0x2000
#define TYPE_TOKEN 0x4000
#define TYPE_QUICKPLAY 0x10000
#define TYPE_CONTINUOUS 0x20000
#define TYPE_EQUIP 0x40000
#define TYPE_FIELD 0x80000
#define TYPE_COUNTER 0x100000
#define TYPE_FLIP 0x200000
#define TYPE_TOON 0x400000
#define TYPE_XYZ 0x800000
#define TYPE_PENDULUM 0x1000000
#define TYPE_SPSUMMON 0x2000000
#define TYPE_LINK 0x4000000
struct CardData {
QString Code;
QString Alias;
unsigned long long Setcode;
unsigned int Type;
unsigned int Level;
unsigned int Attribute;
unsigned int Race;
int Attack;
int Defense;
unsigned int Lscale;
unsigned int Rscale;
unsigned int LinkMarker;
unsigned int Ot;
unsigned int Category;
QString Name;
QString Text;
QString Desc[16];
QString GetTrueCode() const
{
if (Alias.compare("0") == 0)
return Code;
return Alias;
}
QString GetContent() const
{
QString temp;
temp = Code+"\n";
/*temp += to_string(Alias)+"\n";
temp += to_string(Setcode)+"\n";
temp += to_string(Type)+"\n";
temp += to_string(Level)+"\n";
temp += to_string(Attribute)+"\n";
temp += to_string(Race)+"\n";
temp += to_string(Attack)+"\n";
temp += to_string(Defense)+"\n";
temp += to_string(Lscale)+"\n";
temp += to_string(Rscale)+"\n";
temp += to_string(LinkMarker)+"\n";
temp += to_string(Ot)+"\n";
temp += to_string(Category)+"\n";*/
temp += Name+"\n";
temp += Text+"\n";
/*for (int i = 0 ; i < 16 ;++i)
{
temp += Desc[i]+" ";
}*/
return temp;
}
};
enum LocationInfo
{
Unknown = 0,
Tab1MainDeck = 1,
Tab1ExtraDeck = 2,
Tab1SideDeck = 3,
SearchWidget = 4,
Tab2MainDeck = 5,
Tab2EditDeck = 6,
};
#endif // COMMON_H