-
Notifications
You must be signed in to change notification settings - Fork 6
/
basic.h
122 lines (100 loc) · 2.73 KB
/
basic.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
#ifndef BASIC_H
#define BASIC_H
#include <QObject>
#include <QDebug>
#include <QIcon>
#define PROGRAM_NAME_CN "最佳附魔顺序计算器"
#define PROGRAM_NAME_EN "The Best Enchanting Sequence"
#define VERSION "2.2.1_Beta"
#define VERSION_ID 12410140 //NyymmXXx; N:1, yy:the two last number of recent year, mm:recent month, XX:version number, x:small number
#define AUTHOR "Dinosaur_MC(Dinosaur-MC)"
#define WEBSITE "https://github.com/Dinosaur-MC/BestEnchSeq"
#define UPDATE_JSON "https://raw.githubusercontent.com/Dinosaur-MC/BestEnchSeq/main/update.json"
#define STATEMENT "本程序为Github开源项目,完全免费使用!只推荐通过官方渠道获取本程序。\n任何对原程序进行收费售卖行为均为诈骗,谨防上当受骗!谨慎使用来路不明的非官方发布版本,谨防病毒入侵!"
#define FILE_CONFIG "config.ini"
#define FILE_WEAPONTABLE "WeaponTable.csv"
#define FILE_ENCHTABLE "EnchantmentTable.csv"
#define TEXT_NOTE_SYMBOL '#'
#define CONFIG_NUM 8
#define INIT_LENGTH 64
#define ID_ECB "附魔书\nEnchanted Book"
struct Config {
int default_edition;
int default_algorithm;
QString export_path;
bool constant;
bool enableCustomEn;
bool enableCustomWe;
bool autoCheckUpdate;
bool enableReszieWindow;
};
struct Weapon {
QString name;
QIcon icon;
};
struct EnchTable {
QString name;
int mlvl;
int multiplier[2];
int edition;
QString repulsion[INIT_LENGTH];
int suitable[INIT_LENGTH];
};
struct Ench {
QString name;
int lvl;
};
struct EnchPlus {
Ench e;
int mlvl;
};
struct Item {
QString name;
Ench ench[INIT_LENGTH];
int duration;
int penalty;
};
struct Step {
Item a;
Item b;
int cost;
int penalty;
};
class Basic : public QObject
{
Q_OBJECT
public:
explicit Basic(QObject *parent = nullptr);
~Basic();
//Config
static Config config;
static int edition;
static int mode[2];
static bool lever[3];
//Array
static int ench_table_l;
static int weapon_l;
static int origin_ench_l;
static int needed_ench_l;
static int available_item_l;
static int flow_list_l;
static EnchTable *ench_table;
static Weapon *weapon;
static Ench *origin_ench;
static Ench *needed_ench;
static Item *available_item;
static Step *flow_list;
//Variable
static Item OriginItem;
static Item OutputItem;
static int sumCost;
//Public Method
static int searchTable(QString aim);
static int searchWeapon(QString aim);
static int searchEnch(Ench *src, int len, QString aim);
static int compareEnch(Ench *e1, Ench *e2, int len);
static QString IntToRoman(int num);
static int compareItem(Item A, Item B);
signals:
};
#endif // BASIC_H