-
Notifications
You must be signed in to change notification settings - Fork 7
/
itempool.h
71 lines (54 loc) · 1.35 KB
/
itempool.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
#ifndef ITEMPOOL_H
#define ITEMPOOL_H
#include <QObject>
#include "basic.h"
enum StorageMode {
AutoSize,
FixedSize,
MinimunSize
};
enum ForgeMode {
Normal,
IgnoreFixing,
IgnorePenalty,
IgnoreFixing_Penalty
};
int combine(QString ench, int a, int b);
class ItemPool : public QObject
{
Q_OBJECT
public:
explicit ItemPool(QObject *parent = nullptr);
void setStorageMode(enum StorageMode);
int detectSize();
void resize(int size); //Warning: Be careful, or datas might be lost!
void insert(Item item, int p);
void append(Item item);
void replace(Item item, int p);
void remove(Item item);
void remove(int p);
void sort();
int searchWeapon();
int penaltyAreaBegin(int pen);
int penaltyAreaEnd(int pen);
int count();
int size();
Item item(int p);
int maxPenalty();
int minPenalty();
int maxLevelCost();
int minLevelCost();
int maxCost();
int minCost();
void setForgeMode(ForgeMode mode);
static Step preForge(Item A, Item B, ForgeMode mode); //mode; 0:Normal, 1:Ignore pennalty, 2:Ignore duration, 3:Ignore both
static int preForge(Item it, ForgeMode mode);
static Item forge(Item A, Item B);
private:
ForgeMode forgeMode;
StorageMode storage_mode;
int pool_l, item_count;
Item *pool;
signals:
};
#endif // ITEMPOOL_H