Use field names instead of numbers for CDClient tables (#945)

This commit is contained in:
David Markowitz
2023-01-07 01:48:59 -08:00
committed by GitHub
parent a580e3a2f5
commit 8920cd1063
39 changed files with 488 additions and 450 deletions

View File

@@ -21,21 +21,21 @@ CDItemSetsTable::CDItemSetsTable(void) {
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSets");
while (!tableData.eof()) {
CDItemSets entry;
entry.setID = tableData.getIntField(0, -1);
entry.locStatus = tableData.getIntField(1, -1);
entry.itemIDs = tableData.getStringField(2, "");
entry.kitType = tableData.getIntField(3, -1);
entry.kitRank = tableData.getIntField(4, -1);
entry.kitImage = tableData.getIntField(5, -1);
entry.skillSetWith2 = tableData.getIntField(6, -1);
entry.skillSetWith3 = tableData.getIntField(7, -1);
entry.skillSetWith4 = tableData.getIntField(8, -1);
entry.skillSetWith5 = tableData.getIntField(9, -1);
entry.skillSetWith6 = tableData.getIntField(10, -1);
entry.localize = tableData.getIntField(11, -1) == 1 ? true : false;
entry.gate_version = tableData.getStringField(12, "");
entry.kitID = tableData.getIntField(13, -1);
entry.priority = tableData.getFloatField(14, -1.0f);
entry.setID = tableData.getIntField("setID", -1);
entry.locStatus = tableData.getIntField("locStatus", -1);
entry.itemIDs = tableData.getStringField("itemIDs", "");
entry.kitType = tableData.getIntField("kitType", -1);
entry.kitRank = tableData.getIntField("kitRank", -1);
entry.kitImage = tableData.getIntField("kitImage", -1);
entry.skillSetWith2 = tableData.getIntField("skillSetWith2", -1);
entry.skillSetWith3 = tableData.getIntField("skillSetWith3", -1);
entry.skillSetWith4 = tableData.getIntField("skillSetWith4", -1);
entry.skillSetWith5 = tableData.getIntField("skillSetWith5", -1);
entry.skillSetWith6 = tableData.getIntField("skillSetWith6", -1);
entry.localize = tableData.getIntField("localize", -1) == 1 ? true : false;
entry.gate_version = tableData.getStringField("gate_version", "");
entry.kitID = tableData.getIntField("kitID", -1);
entry.priority = tableData.getFloatField("priority", -1.0f);
this->entries.push_back(entry);
tableData.nextRow();
@@ -66,3 +66,4 @@ std::vector<CDItemSets> CDItemSetsTable::Query(std::function<bool(CDItemSets)> p
std::vector<CDItemSets> CDItemSetsTable::GetEntries(void) const {
return this->entries;
}