Commit ceb94a04 authored by salix5's avatar salix5

add CardDataC::rule_code

parent e8e7124e
...@@ -7,11 +7,11 @@ namespace ygo { ...@@ -7,11 +7,11 @@ namespace ygo {
unsigned char DataManager::scriptBuffer[0x100000] = {}; unsigned char DataManager::scriptBuffer[0x100000] = {};
DataManager dataManager; DataManager dataManager;
static const char SELECT_STMT[] = "SELECT datas.id, datas.ot, datas.alias, datas.setcode, datas.type, datas.atk, datas.def, datas.level, datas.race, datas.attribute, datas.category," static const char SELECT_STMT[] = "SELECT datas.id, datas.ot, datas.alias, datas.setcode, datas.type, datas.atk, datas.def, datas.level, datas.race, datas.attribute, datas.category, datas.rule_code"
" texts.name, texts.desc, texts.str1, texts.str2, texts.str3, texts.str4, texts.str5, texts.str6, texts.str7, texts.str8," " texts.name, texts.desc, texts.str1, texts.str2, texts.str3, texts.str4, texts.str5, texts.str6, texts.str7, texts.str8,"
" texts.str9, texts.str10, texts.str11, texts.str12, texts.str13, texts.str14, texts.str15, texts.str16 FROM datas INNER JOIN texts ON datas.id = texts.id"; " texts.str9, texts.str10, texts.str11, texts.str12, texts.str13, texts.str14, texts.str15, texts.str16 FROM datas INNER JOIN texts ON datas.id = texts.id";
constexpr int DATAS_COUNT = 11; constexpr int DATAS_COUNT = 12;
DataManager::DataManager() : _datas(32768), _strings(32768) { DataManager::DataManager() : _datas(32768), _strings(32768) {
extra_setcode = { extra_setcode = {
...@@ -50,6 +50,7 @@ bool DataManager::ReadDB(sqlite3* pDB) { ...@@ -50,6 +50,7 @@ bool DataManager::ReadDB(sqlite3* pDB) {
cd.race = static_cast<decltype(cd.race)>(sqlite3_column_int64(pStmt, 8)); cd.race = static_cast<decltype(cd.race)>(sqlite3_column_int64(pStmt, 8));
cd.attribute = static_cast<decltype(cd.attribute)>(sqlite3_column_int64(pStmt, 9)); cd.attribute = static_cast<decltype(cd.attribute)>(sqlite3_column_int64(pStmt, 9));
cd.category = static_cast<decltype(cd.category)>(sqlite3_column_int64(pStmt, 10)); cd.category = static_cast<decltype(cd.category)>(sqlite3_column_int64(pStmt, 10));
cd.rule_code = static_cast<decltype(cd.rule_code)>(sqlite3_column_int64(pStmt, 11));
auto& cs = _strings[code]; auto& cs = _strings[code];
if (const char* text = (const char*)sqlite3_column_text(pStmt, DATAS_COUNT + 0)) { if (const char* text = (const char*)sqlite3_column_text(pStmt, DATAS_COUNT + 0)) {
BufferIO::DecodeUTF8(text, strBuffer); BufferIO::DecodeUTF8(text, strBuffer);
......
...@@ -34,6 +34,9 @@ struct CardDataC { ...@@ -34,6 +34,9 @@ struct CardDataC {
uint32_t lscale{}; uint32_t lscale{};
uint32_t rscale{}; uint32_t rscale{};
uint32_t link_marker{}; uint32_t link_marker{};
uint32_t rule_code{};
// extra columns
uint32_t ot{}; uint32_t ot{};
uint32_t category{}; uint32_t category{};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment