format codebase

This commit is contained in:
aronwk-aaron
2022-07-28 08:39:57 -05:00
parent 4f7aa11067
commit 19e77a38d8
881 changed files with 34700 additions and 38689 deletions

View File

@@ -2,39 +2,39 @@
//! Constructor
CDScriptComponentTable::CDScriptComponentTable(void) {
// First, get the size of the table
unsigned int size = 0;
auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ScriptComponent");
while (!tableSize.eof()) {
size = tableSize.getIntField(0, 0);
tableSize.nextRow();
}
// First, get the size of the table
unsigned int size = 0;
auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ScriptComponent");
while (!tableSize.eof()) {
size = tableSize.getIntField(0, 0);
tableSize.nextRow();
}
tableSize.finalize();
// Now get the data
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ScriptComponent");
while (!tableData.eof()) {
CDScriptComponent entry;
entry.id = tableData.getIntField(0, -1);
entry.script_name = tableData.getStringField(1, "");
entry.client_script_name = tableData.getStringField(2, "");
// Now get the data
auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ScriptComponent");
while (!tableData.eof()) {
CDScriptComponent entry;
entry.id = tableData.getIntField(0, -1);
entry.script_name = tableData.getStringField(1, "");
entry.client_script_name = tableData.getStringField(2, "");
this->entries.insert(std::make_pair(entry.id, entry));
tableData.nextRow();
}
tableData.nextRow();
}
tableData.finalize();
}
//! Destructor
CDScriptComponentTable::~CDScriptComponentTable(void) { }
CDScriptComponentTable::~CDScriptComponentTable(void) {}
//! Returns the table's name
std::string CDScriptComponentTable::GetName(void) const {
return "ScriptComponent";
return "ScriptComponent";
}
const CDScriptComponent& CDScriptComponentTable::GetByID(unsigned int id) {
@@ -44,4 +44,4 @@ const CDScriptComponent& CDScriptComponentTable::GetByID(unsigned int id) {
}
return m_ToReturnWhenNoneFound;
}
}