mirror of
https://github.com/DarwinAnim8or/DarkflameServerNostalgiaMax.git
synced 2025-12-21 13:29:37 -06:00
51 lines
1.5 KiB
C++
51 lines
1.5 KiB
C++
#include "CDLootMatrixTable.h"
|
|
//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.108537
|
|
//DO NOT EDIT THIS FILE MANUALLY!
|
|
|
|
CDLootMatrixTable::CDLootMatrixTable() {
|
|
unsigned int size = 0;
|
|
auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootMatrix");
|
|
while (!tableSize.eof()) {
|
|
size = tableSize.getIntField(0, 0);
|
|
tableSize.nextRow();
|
|
}
|
|
|
|
tableSize.finalize();
|
|
this->m_entries.reserve(size);
|
|
|
|
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootMatrix");
|
|
while (!tableData.eof()) {
|
|
CDLootMatrix entry;
|
|
entry.LootMatrixIndex = tableData.getIntField(0, int{});
|
|
entry.LootTableIndex = tableData.getIntField(1, int{});
|
|
entry.RarityTableIndex = tableData.getIntField(2, int{});
|
|
entry.percent = tableData.getFloatField(3, float{});
|
|
entry.minToDrop = tableData.getIntField(4, int{});
|
|
entry.maxToDrop = tableData.getIntField(5, int{});
|
|
entry.id = tableData.getIntField(6, int{});
|
|
this->m_entries.push_back(entry);
|
|
tableData.nextRow();
|
|
}
|
|
|
|
tableData.finalize();
|
|
}
|
|
|
|
CDLootMatrixTable::~CDLootMatrixTable() {
|
|
}
|
|
|
|
std::string CDLootMatrixTable::GetName(void) const {
|
|
return "LootMatrix";
|
|
}
|
|
|
|
std::vector<CDLootMatrix> CDLootMatrixTable::Query(std::function<bool(CDLootMatrix)> predicate) {
|
|
std::vector<CDLootMatrix> data = cpplinq::from(this->m_entries)
|
|
>> cpplinq::where(predicate)
|
|
>> cpplinq::to_vector();
|
|
|
|
return data;
|
|
}
|
|
|
|
std::vector<CDLootMatrix> CDLootMatrixTable::GetEntries(void) const {
|
|
return this->m_entries;
|
|
}
|