diff --git a/dDatabase/CDClientManager.cpp b/dDatabase/CDClientManager.cpp index 7ad852b..7d0afc1 100644 --- a/dDatabase/CDClientManager.cpp +++ b/dDatabase/CDClientManager.cpp @@ -12,15 +12,15 @@ void CDClientManager::Initialize(void) { tables.insert(std::make_pair("ComponentsRegistry", new CDComponentsRegistryTable())); tables.insert(std::make_pair("CurrencyTable", new CDCurrencyTableTable())); tables.insert(std::make_pair("DestructibleComponent", new CDDestructibleComponentTable())); - tables.insert(std::make_pair("EmoteTable", new CDEmoteTableTable())); + tables.insert(std::make_pair("EmotesTable", new CDEmotesTable())); tables.insert(std::make_pair("InventoryComponent", new CDInventoryComponentTable())); tables.insert(std::make_pair("ItemComponent", new CDItemComponentTable())); tables.insert(std::make_pair("ItemSets", new CDItemSetsTable())); tables.insert(std::make_pair("ItemSetSkills", new CDItemSetSkillsTable())); - tables.insert(std::make_pair("LevelProgressionLookup", new CDLevelProgressionLookupTable())); + /*tables.insert(std::make_pair("LevelProgressionLookup", new CDLevelProgressionLookupTable()));*/ tables.insert(std::make_pair("LootMatrix", new CDLootMatrixTable())); tables.insert(std::make_pair("LootTable", new CDLootTableTable())); - tables.insert(std::make_pair("MissionNPCComponent", new CDMissionNPCComponentTable())); + /*tables.insert(std::make_pair("MissionNPCComponent", new CDMissionNPCComponentTable()));*/ tables.insert(std::make_pair("MissionTasks", new CDMissionTasksTable())); tables.insert(std::make_pair("Missions", new CDMissionsTable())); tables.insert(std::make_pair("ObjectSkills", new CDObjectSkillsTable())); @@ -33,14 +33,12 @@ void CDClientManager::Initialize(void) { tables.insert(std::make_pair("VendorComponent", new CDVendorComponentTable())); tables.insert(std::make_pair("Activities", new CDActivitiesTable())); tables.insert(std::make_pair("PackageComponent", new CDPackageComponentTable())); - tables.insert(std::make_pair("ProximityMonitorComponent", new CDProximityMonitorComponentTable())); - tables.insert(std::make_pair("MovementAIComponent", new CDMovementAIComponentTable())); + //tables.insert(std::make_pair("ProximityMonitorComponent", new CDProximityMonitorComponentTable())); + //tables.insert(std::make_pair("MovementAIComponent", new CDMovementAIComponentTable())); tables.insert(std::make_pair("BrickIDTable", new CDBrickIDTableTable())); tables.insert(std::make_pair("RarityTable", new CDRarityTableTable())); - tables.insert(std::make_pair("MissionEmail", new CDMissionEmailTable())); - tables.insert(std::make_pair("Rewards", new CDRewardsTable())); - tables.insert(std::make_pair("PropertyEntranceComponent", new CDPropertyEntranceComponentTable())); + //tables.insert(std::make_pair("MissionEmail", new CDMissionEmailTable())); + //tables.insert(std::make_pair("Rewards", new CDRewardsTable())); + //tables.insert(std::make_pair("PropertyEntranceComponent", new CDPropertyEntranceComponentTable())); tables.insert(std::make_pair("PropertyTemplate", new CDPropertyTemplateTable())); - tables.insert(std::make_pair("FeatureGating", new CDFeatureGatingTable())); - tables.insert(std::make_pair("RailActivatorComponent", new CDRailActivatorComponentTable())); } diff --git a/dDatabase/CDClientManager.h b/dDatabase/CDClientManager.h index f4530f9..278af7f 100644 --- a/dDatabase/CDClientManager.h +++ b/dDatabase/CDClientManager.h @@ -11,15 +11,14 @@ #include "CDComponentsRegistryTable.h" #include "CDCurrencyTableTable.h" #include "CDDestructibleComponentTable.h" -#include "CDEmoteTable.h" +#include "CDEmotesTable.h" #include "CDInventoryComponentTable.h" #include "CDItemComponentTable.h" #include "CDItemSetsTable.h" #include "CDItemSetSkillsTable.h" -#include "CDLevelProgressionLookupTable.h" #include "CDLootMatrixTable.h" #include "CDLootTableTable.h" -#include "CDMissionNPCComponentTable.h" +//#include "CDMissionNPCComponentTable.h" #include "CDMissionTasksTable.h" #include "CDMissionsTable.h" #include "CDObjectSkillsTable.h" @@ -32,16 +31,16 @@ #include "CDVendorComponentTable.h" #include "CDActivitiesTable.h" #include "CDPackageComponentTable.h" -#include "CDProximityMonitorComponentTable.h" -#include "CDMovementAIComponentTable.h" +//#include "CDProximityMonitorComponentTable.h" +//#include "CDMovementAIComponentTable.h" #include "CDBrickIDTableTable.h" #include "CDRarityTableTable.h" -#include "CDMissionEmailTable.h" -#include "CDRewardsTable.h" -#include "CDPropertyEntranceComponentTable.h" +//#include "CDMissionEmailTable.h" +//#include "CDRewardsTable.h" +//#include "CDPropertyEntranceComponentTable.h" #include "CDPropertyTemplateTable.h" -#include "CDFeatureGatingTable.h" -#include "CDRailActivatorComponent.h" +//#include "CDFeatureGatingTable.h" +//#include "CDRailActivatorComponent.h" // C++ #include diff --git a/dDatabase/Tables/CDAICombatBehaviorTypesTable.cpp b/dDatabase/Tables/CDAICombatBehaviorTypesTable.cpp new file mode 100644 index 0000000..f76092c --- /dev/null +++ b/dDatabase/Tables/CDAICombatBehaviorTypesTable.cpp @@ -0,0 +1,45 @@ +#include "CDAICombatBehaviorTypesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.856100 +//DO NOT EDIT THIS FILE MANUALLY! + +CDAICombatBehaviorTypesTable::CDAICombatBehaviorTypesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM AICombatBehaviorTypes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM AICombatBehaviorTypes"); + while (!tableData.eof()) { + CDAICombatBehaviorTypes entry; + entry.id = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDAICombatBehaviorTypesTable::~CDAICombatBehaviorTypesTable() { +} + +std::string CDAICombatBehaviorTypesTable::GetName(void) const { + return "AICombatBehaviorTypes"; +} + +std::vector CDAICombatBehaviorTypesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDAICombatBehaviorTypesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDAICombatBehaviorTypesTable.h b/dDatabase/Tables/CDAICombatBehaviorTypesTable.h new file mode 100644 index 0000000..ab0db98 --- /dev/null +++ b/dDatabase/Tables/CDAICombatBehaviorTypesTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.855105 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDAICombatBehaviorTypes { + int id; + std::string name; +}; + +class CDAICombatBehaviorTypesTable : public CDTable { +private: + std::vector m_entries; +public: + CDAICombatBehaviorTypesTable(); + ~CDAICombatBehaviorTypesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDAICombatRoleTypesTable.cpp b/dDatabase/Tables/CDAICombatRoleTypesTable.cpp new file mode 100644 index 0000000..59ac010 --- /dev/null +++ b/dDatabase/Tables/CDAICombatRoleTypesTable.cpp @@ -0,0 +1,45 @@ +#include "CDAICombatRoleTypesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.862694 +//DO NOT EDIT THIS FILE MANUALLY! + +CDAICombatRoleTypesTable::CDAICombatRoleTypesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM AICombatRoleTypes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM AICombatRoleTypes"); + while (!tableData.eof()) { + CDAICombatRoleTypes entry; + entry.id = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDAICombatRoleTypesTable::~CDAICombatRoleTypesTable() { +} + +std::string CDAICombatRoleTypesTable::GetName(void) const { + return "AICombatRoleTypes"; +} + +std::vector CDAICombatRoleTypesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDAICombatRoleTypesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDAICombatRoleTypesTable.h b/dDatabase/Tables/CDAICombatRoleTypesTable.h new file mode 100644 index 0000000..106b463 --- /dev/null +++ b/dDatabase/Tables/CDAICombatRoleTypesTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.862458 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDAICombatRoleTypes { + int id; + std::string name; +}; + +class CDAICombatRoleTypesTable : public CDTable { +private: + std::vector m_entries; +public: + CDAICombatRoleTypesTable(); + ~CDAICombatRoleTypesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDAICombatRolesTable.cpp b/dDatabase/Tables/CDAICombatRolesTable.cpp new file mode 100644 index 0000000..4a27763 --- /dev/null +++ b/dDatabase/Tables/CDAICombatRolesTable.cpp @@ -0,0 +1,50 @@ +#include "CDAICombatRolesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.859415 +//DO NOT EDIT THIS FILE MANUALLY! + +CDAICombatRolesTable::CDAICombatRolesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM AICombatRoles"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM AICombatRoles"); + while (!tableData.eof()) { + CDAICombatRoles entry; + entry.id = tableData.getIntField(0, int{}); + entry.preferredRole = tableData.getIntField(1, int{}); + entry.description = tableData.getStringField(2, std::string{}.c_str()); + entry.specifiedMinRangeNOUSE = tableData.getFloatField(3, float{}); + entry.specifiedMaxRangeNOUSE = tableData.getFloatField(4, float{}); + entry.specificMinRange = tableData.getFloatField(5, float{}); + entry.specificMaxRange = tableData.getFloatField(6, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDAICombatRolesTable::~CDAICombatRolesTable() { +} + +std::string CDAICombatRolesTable::GetName(void) const { + return "AICombatRoles"; +} + +std::vector CDAICombatRolesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDAICombatRolesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDAICombatRolesTable.h b/dDatabase/Tables/CDAICombatRolesTable.h new file mode 100644 index 0000000..569095a --- /dev/null +++ b/dDatabase/Tables/CDAICombatRolesTable.h @@ -0,0 +1,27 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.858188 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDAICombatRoles { + int id; + int preferredRole; + std::string description; + float specifiedMinRangeNOUSE; + float specifiedMaxRangeNOUSE; + float specificMinRange; + float specificMaxRange; +}; + +class CDAICombatRolesTable : public CDTable { +private: + std::vector m_entries; +public: + CDAICombatRolesTable(); + ~CDAICombatRolesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDAccessoryDefaultLocTable.cpp b/dDatabase/Tables/CDAccessoryDefaultLocTable.cpp new file mode 100644 index 0000000..e01c5ad --- /dev/null +++ b/dDatabase/Tables/CDAccessoryDefaultLocTable.cpp @@ -0,0 +1,51 @@ +#include "CDAccessoryDefaultLocTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.841621 +//DO NOT EDIT THIS FILE MANUALLY! + +CDAccessoryDefaultLocTable::CDAccessoryDefaultLocTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM AccessoryDefaultLoc"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM AccessoryDefaultLoc"); + while (!tableData.eof()) { + CDAccessoryDefaultLoc entry; + entry.GroupID = tableData.getIntField(0, int{}); + entry.Description = tableData.getStringField(1, std::string{}.c_str()); + entry.Pos_X = tableData.getFloatField(2, float{}); + entry.Pos_Y = tableData.getFloatField(3, float{}); + entry.Pos_Z = tableData.getFloatField(4, float{}); + entry.Rot_X = tableData.getFloatField(5, float{}); + entry.Rot_Y = tableData.getFloatField(6, float{}); + entry.Rot_Z = tableData.getFloatField(7, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDAccessoryDefaultLocTable::~CDAccessoryDefaultLocTable() { +} + +std::string CDAccessoryDefaultLocTable::GetName(void) const { + return "AccessoryDefaultLoc"; +} + +std::vector CDAccessoryDefaultLocTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDAccessoryDefaultLocTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDAccessoryDefaultLocTable.h b/dDatabase/Tables/CDAccessoryDefaultLocTable.h new file mode 100644 index 0000000..0bfd668 --- /dev/null +++ b/dDatabase/Tables/CDAccessoryDefaultLocTable.h @@ -0,0 +1,28 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.840625 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDAccessoryDefaultLoc { + int GroupID; + std::string Description; + float Pos_X; + float Pos_Y; + float Pos_Z; + float Rot_X; + float Rot_Y; + float Rot_Z; +}; + +class CDAccessoryDefaultLocTable : public CDTable { +private: + std::vector m_entries; +public: + CDAccessoryDefaultLocTable(); + ~CDAccessoryDefaultLocTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDActivitiesTable.cpp b/dDatabase/Tables/CDActivitiesTable.cpp index daa07b5..5d5c1ed 100644 --- a/dDatabase/Tables/CDActivitiesTable.cpp +++ b/dDatabase/Tables/CDActivitiesTable.cpp @@ -1,72 +1,59 @@ #include "CDActivitiesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.846608 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDActivitiesTable::CDActivitiesTable(void) { - - // First, get the size of the table +CDActivitiesTable::CDActivitiesTable() { unsigned int size = 0; auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Activities"); - while (!tableSize.eof()) { + while (!tableSize.eof()) { size = tableSize.getIntField(0, 0); - tableSize.nextRow(); } tableSize.finalize(); + this->m_entries.reserve(size); - // Reserve the size - this->entries.reserve(size); - - // Now get the data auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Activities"); while (!tableData.eof()) { CDActivities entry; - entry.ActivityID = tableData.getIntField(0, -1); - entry.locStatus = tableData.getIntField(1, -1); - entry.instanceMapID = tableData.getIntField(2, -1); - entry.minTeams = tableData.getIntField(3, -1); - entry.maxTeams = tableData.getIntField(4, -1); - entry.minTeamSize = tableData.getIntField(5, -1); - entry.maxTeamSize = tableData.getIntField(6, -1); - entry.waitTime = tableData.getIntField(7, -1); - entry.startDelay = tableData.getIntField(8, -1); - entry.requiresUniqueData = tableData.getIntField(9, -1); - entry.leaderboardType = tableData.getIntField(10, -1); - entry.localize = tableData.getIntField(11, -1); - entry.optionalCostLOT = tableData.getIntField(12, -1); - entry.optionalCostCount = tableData.getIntField(13, -1); - entry.showUIRewards = tableData.getIntField(14, -1); - entry.CommunityActivityFlagID = tableData.getIntField(15, -1); - entry.gate_version = tableData.getStringField(16, ""); - entry.noTeamLootOnDeath = tableData.getIntField(17, -1); - entry.optionalPercentage = tableData.getFloatField(18, -1.0f); - - this->entries.push_back(entry); + entry.ActivityID = tableData.getIntField(0, int{}); + entry.Description = tableData.getStringField(1, std::string{}.c_str()); + entry.ActivityName = tableData.getStringField(2, std::string{}.c_str()); + entry.scoreName = tableData.getStringField(3, std::string{}.c_str()); + entry.value1Name = tableData.getStringField(4, std::string{}.c_str()); + entry.value2Name = tableData.getStringField(5, std::string{}.c_str()); + entry.scoreSort = tableData.getIntField(6, bool{}); + entry.value1Sort = tableData.getIntField(7, bool{}); + entry.value2Sort = tableData.getIntField(8, bool{}); + entry.instanceMapID = tableData.getIntField(9, int{}); + entry.minTeams = tableData.getIntField(10, int{}); + entry.maxTeams = tableData.getIntField(11, int{}); + entry.minTeamSize = tableData.getIntField(12, int{}); + entry.maxTeamSize = tableData.getIntField(13, int{}); + entry.waitTime = tableData.getIntField(14, int{}); + entry.startDelay = tableData.getIntField(15, int{}); + this->m_entries.push_back(entry); tableData.nextRow(); } tableData.finalize(); } -//! Destructor -CDActivitiesTable::~CDActivitiesTable(void) { } +CDActivitiesTable::~CDActivitiesTable() { +} -//! Returns the table's name std::string CDActivitiesTable::GetName(void) const { return "Activities"; } -//! Queries the table with a custom "where" clause std::vector CDActivitiesTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) + std::vector data = cpplinq::from(this->m_entries) >> cpplinq::where(predicate) >> cpplinq::to_vector(); return data; } -//! Gets all the entries in the table std::vector CDActivitiesTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDActivitiesTable.h b/dDatabase/Tables/CDActivitiesTable.h index 51c560c..ac5b793 100644 --- a/dDatabase/Tables/CDActivitiesTable.h +++ b/dDatabase/Tables/CDActivitiesTable.h @@ -1,66 +1,36 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDActivitiesTable.hpp - \brief Contains data for the Activities table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.845612 +//DO NOT EDIT THIS FILE MANUALLY! - //! Activities Entry Struct struct CDActivities { - unsigned int ActivityID; - unsigned int locStatus; - unsigned int instanceMapID; - unsigned int minTeams; - unsigned int maxTeams; - unsigned int minTeamSize; - unsigned int maxTeamSize; - unsigned int waitTime; - unsigned int startDelay; - bool requiresUniqueData; - unsigned int leaderboardType; - bool localize; - int optionalCostLOT; - int optionalCostCount; - bool showUIRewards; - unsigned int CommunityActivityFlagID; - std::string gate_version; - bool noTeamLootOnDeath; - float optionalPercentage; + int ActivityID; + std::string Description; + std::string ActivityName; + std::string scoreName; + std::string value1Name; + std::string value2Name; + bool scoreSort; + bool value1Sort; + bool value2Sort; + int instanceMapID; + int minTeams; + int maxTeams; + int minTeamSize; + int maxTeamSize; + int waitTime; + int startDelay; }; - -//! Activities table class CDActivitiesTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDActivitiesTable(void); - - //! Destructor - ~CDActivitiesTable(void); - - //! Returns the table's name - /*! - \return The table name - */ + CDActivitiesTable(); + ~CDActivitiesTable(); std::string GetName(void) const override; - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ +std::vector Query(std::function predicate); std::vector GetEntries(void) const; - }; diff --git a/dDatabase/Tables/CDActivityRewardsTable.cpp b/dDatabase/Tables/CDActivityRewardsTable.cpp index 03424de..7d4f04f 100644 --- a/dDatabase/Tables/CDActivityRewardsTable.cpp +++ b/dDatabase/Tables/CDActivityRewardsTable.cpp @@ -1,60 +1,50 @@ #include "CDActivityRewardsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.848603 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDActivityRewardsTable::CDActivityRewardsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ActivityRewards"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } +CDActivityRewardsTable::CDActivityRewardsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ActivityRewards"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ActivityRewards"); - while (!tableData.eof()) { - CDActivityRewards entry; - entry.objectTemplate = tableData.getIntField(0, -1); - entry.ActivityRewardIndex = tableData.getIntField(1, -1); - entry.activityRating = tableData.getIntField(2, -1); - entry.LootMatrixIndex = tableData.getIntField(3, -1); - entry.CurrencyIndex = tableData.getIntField(4, -1); - entry.ChallengeRating = tableData.getIntField(5, -1); - entry.description = tableData.getStringField(6, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ActivityRewards"); + while (!tableData.eof()) { + CDActivityRewards entry; + entry.objectTemplate = tableData.getIntField(0, int{}); + entry.ActivityRewardIndex = tableData.getIntField(1, int{}); + entry.activityRating = tableData.getIntField(2, int{}); + entry.LootMatrixIndex = tableData.getIntField(3, int{}); + entry.CurrencyIndex = tableData.getIntField(4, int{}); + entry.ChallengeRating = tableData.getIntField(5, int{}); + entry.description = tableData.getStringField(6, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDActivityRewardsTable::~CDActivityRewardsTable(void) { } +CDActivityRewardsTable::~CDActivityRewardsTable() { +} -//! Returns the table's name std::string CDActivityRewardsTable::GetName(void) const { - return "ActivityRewards"; + return "ActivityRewards"; } -//! Queries the table with a custom "where" clause std::vector CDActivityRewardsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDActivityRewardsTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDActivityRewardsTable.h b/dDatabase/Tables/CDActivityRewardsTable.h index fb3a5b0..fa6213a 100644 --- a/dDatabase/Tables/CDActivityRewardsTable.h +++ b/dDatabase/Tables/CDActivityRewardsTable.h @@ -1,54 +1,27 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDActivityRewardsTable.hpp - \brief Contains data for the ActivityRewards table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.847606 +//DO NOT EDIT THIS FILE MANUALLY! -//! ActivityRewards Entry Struct struct CDActivityRewards { - unsigned int objectTemplate; //!< The object template (?) - unsigned int ActivityRewardIndex; //!< The activity reward index - int activityRating; //!< The activity rating - unsigned int LootMatrixIndex; //!< The loot matrix index - unsigned int CurrencyIndex; //!< The currency index - unsigned int ChallengeRating; //!< The challenge rating - std::string description; //!< The description + int objectTemplate; + int ActivityRewardIndex; + int activityRating; + int LootMatrixIndex; + int CurrencyIndex; + int ChallengeRating; + std::string description; }; - -//! ActivityRewards table class CDActivityRewardsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDActivityRewardsTable(void); - - //! Destructor - ~CDActivityRewardsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDActivityRewardsTable(); + ~CDActivityRewardsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDActivityTextTable.cpp b/dDatabase/Tables/CDActivityTextTable.cpp new file mode 100644 index 0000000..16b7fd1 --- /dev/null +++ b/dDatabase/Tables/CDActivityTextTable.cpp @@ -0,0 +1,46 @@ +#include "CDActivityTextTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.853590 +//DO NOT EDIT THIS FILE MANUALLY! + +CDActivityTextTable::CDActivityTextTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ActivityText"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ActivityText"); + while (!tableData.eof()) { + CDActivityText entry; + entry.activityID = tableData.getIntField(0, int{}); + entry.type = tableData.getStringField(1, std::string{}.c_str()); + entry.text = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDActivityTextTable::~CDActivityTextTable() { +} + +std::string CDActivityTextTable::GetName(void) const { + return "ActivityText"; +} + +std::vector CDActivityTextTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDActivityTextTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDActivityTextTable.h b/dDatabase/Tables/CDActivityTextTable.h new file mode 100644 index 0000000..121eba9 --- /dev/null +++ b/dDatabase/Tables/CDActivityTextTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.851597 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDActivityText { + int activityID; + std::string type; + std::string text; +}; + +class CDActivityTextTable : public CDTable { +private: + std::vector m_entries; +public: + CDActivityTextTable(); + ~CDActivityTextTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDAnimationIndexTable.cpp b/dDatabase/Tables/CDAnimationIndexTable.cpp new file mode 100644 index 0000000..fd8e852 --- /dev/null +++ b/dDatabase/Tables/CDAnimationIndexTable.cpp @@ -0,0 +1,46 @@ +#include "CDAnimationIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.866645 +//DO NOT EDIT THIS FILE MANUALLY! + +CDAnimationIndexTable::CDAnimationIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM AnimationIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM AnimationIndex"); + while (!tableData.eof()) { + CDAnimationIndex entry; + entry.animationGroupID = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.groupType = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDAnimationIndexTable::~CDAnimationIndexTable() { +} + +std::string CDAnimationIndexTable::GetName(void) const { + return "AnimationIndex"; +} + +std::vector CDAnimationIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDAnimationIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDAnimationIndexTable.h b/dDatabase/Tables/CDAnimationIndexTable.h new file mode 100644 index 0000000..7248d60 --- /dev/null +++ b/dDatabase/Tables/CDAnimationIndexTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.864733 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDAnimationIndex { + int animationGroupID; + std::string description; + std::string groupType; +}; + +class CDAnimationIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDAnimationIndexTable(); + ~CDAnimationIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDAnimationsTable.cpp b/dDatabase/Tables/CDAnimationsTable.cpp index 7056f71..665c72b 100644 --- a/dDatabase/Tables/CDAnimationsTable.cpp +++ b/dDatabase/Tables/CDAnimationsTable.cpp @@ -1,66 +1,61 @@ #include "CDAnimationsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.869897 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDAnimationsTable::CDAnimationsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Animations"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } +CDAnimationsTable::CDAnimationsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Animations"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Animations"); - while (!tableData.eof()) { - CDAnimations entry; - entry.animationGroupID = tableData.getIntField(0, -1); - entry.animation_type = tableData.getStringField(1, ""); - entry.animation_name = tableData.getStringField(2, ""); - entry.chance_to_play = tableData.getFloatField(3, -1.0f); - entry.min_loops = tableData.getIntField(4, -1); - entry.max_loops = tableData.getIntField(5, -1); - entry.animation_length = tableData.getFloatField(6, -1.0f); - entry.hideEquip = tableData.getIntField(7, -1) == 1 ? true : false; - entry.ignoreUpperBody = tableData.getIntField(8, -1) == 1 ? true : false; - entry.restartable = tableData.getIntField(9, -1) == 1 ? true : false; - entry.face_animation_name = tableData.getStringField(10, ""); - entry.priority = tableData.getFloatField(11, -1.0f); - entry.blendTime = tableData.getFloatField(12, -1.0f); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Animations"); + while (!tableData.eof()) { + CDAnimations entry; + entry.animationGroupID = tableData.getIntField(0, int{}); + entry.animation_type = tableData.getStringField(1, std::string{}.c_str()); + entry.animation_name = tableData.getStringField(2, std::string{}.c_str()); + entry.chance_to_play = tableData.getFloatField(3, float{}); + entry.min_loops = tableData.getIntField(4, int{}); + entry.max_loops = tableData.getIntField(5, int{}); + entry.animation_length = tableData.getFloatField(6, float{}); + entry.sound1 = tableData.getStringField(7, std::string{}.c_str()); + entry.sound2 = tableData.getStringField(8, std::string{}.c_str()); + entry.sound3 = tableData.getStringField(9, std::string{}.c_str()); + entry.sound4 = tableData.getStringField(10, std::string{}.c_str()); + entry.sound5 = tableData.getStringField(11, std::string{}.c_str()); + entry.leftSound = tableData.getStringField(12, std::string{}.c_str()); + entry.rightSound = tableData.getStringField(13, std::string{}.c_str()); + entry.hideEquip = tableData.getIntField(14, bool{}); + entry.ignoreUpperBody = tableData.getIntField(15, bool{}); + entry.restartable = tableData.getIntField(16, bool{}); + entry.face_animation_name = tableData.getStringField(17, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDAnimationsTable::~CDAnimationsTable(void) { } +CDAnimationsTable::~CDAnimationsTable() { +} -//! Returns the table's name std::string CDAnimationsTable::GetName(void) const { - return "Animations"; + return "Animations"; } -//! Queries the table with a custom "where" clause std::vector CDAnimationsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDAnimationsTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDAnimationsTable.h b/dDatabase/Tables/CDAnimationsTable.h index 61638f7..9e16b25 100644 --- a/dDatabase/Tables/CDAnimationsTable.h +++ b/dDatabase/Tables/CDAnimationsTable.h @@ -1,60 +1,38 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDAnimationsTable.hpp - \brief Contains data for the Animations table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.868915 +//DO NOT EDIT THIS FILE MANUALLY! -//! Animations Entry Struct struct CDAnimations { - unsigned int animationGroupID; //!< The animation group ID - std::string animation_type; //!< The animation type - std::string animation_name; //!< The animation name - float chance_to_play; //!< The chance to play the animation - unsigned int min_loops; //!< The minimum number of loops - unsigned int max_loops; //!< The maximum number of loops - float animation_length; //!< The animation length - bool hideEquip; //!< Whether or not to hide the equip - bool ignoreUpperBody; //!< Whether or not to ignore the upper body - bool restartable; //!< Whether or not the animation is restartable - std::string face_animation_name; //!< The face animation name - float priority; //!< The priority - float blendTime; //!< The blend time + int animationGroupID; + std::string animation_type; + std::string animation_name; + float chance_to_play; + int min_loops; + int max_loops; + float animation_length; + std::string sound1; + std::string sound2; + std::string sound3; + std::string sound4; + std::string sound5; + std::string leftSound; + std::string rightSound; + bool hideEquip; + bool ignoreUpperBody; + bool restartable; + std::string face_animation_name; }; - -//! Animations table class CDAnimationsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDAnimationsTable(void); - - //! Destructor - ~CDAnimationsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDAnimationsTable(); + ~CDAnimationsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDBaseCombatAIComponentTable.cpp b/dDatabase/Tables/CDBaseCombatAIComponentTable.cpp new file mode 100644 index 0000000..0a25ef6 --- /dev/null +++ b/dDatabase/Tables/CDBaseCombatAIComponentTable.cpp @@ -0,0 +1,52 @@ +#include "CDBaseCombatAIComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.872243 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBaseCombatAIComponentTable::CDBaseCombatAIComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BaseCombatAIComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BaseCombatAIComponent"); + while (!tableData.eof()) { + CDBaseCombatAIComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.behaviorType = tableData.getIntField(1, int{}); + entry.combatRoundLength = tableData.getFloatField(2, float{}); + entry.combatRole = tableData.getIntField(3, int{}); + entry.minRoundLength = tableData.getFloatField(4, float{}); + entry.maxRoundLength = tableData.getFloatField(5, float{}); + entry.tetherSpeed = tableData.getFloatField(6, float{}); + entry.pursuitSpeed = tableData.getFloatField(7, float{}); + entry.combatStartDelay = tableData.getFloatField(8, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDBaseCombatAIComponentTable::~CDBaseCombatAIComponentTable() { +} + +std::string CDBaseCombatAIComponentTable::GetName(void) const { + return "BaseCombatAIComponent"; +} + +std::vector CDBaseCombatAIComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDBaseCombatAIComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDBaseCombatAIComponentTable.h b/dDatabase/Tables/CDBaseCombatAIComponentTable.h new file mode 100644 index 0000000..976848e --- /dev/null +++ b/dDatabase/Tables/CDBaseCombatAIComponentTable.h @@ -0,0 +1,29 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.870909 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDBaseCombatAIComponent { + int id; + int behaviorType; + float combatRoundLength; + int combatRole; + float minRoundLength; + float maxRoundLength; + float tetherSpeed; + float pursuitSpeed; + float combatStartDelay; +}; + +class CDBaseCombatAIComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDBaseCombatAIComponentTable(); + ~CDBaseCombatAIComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDBehaviorEffectTable.cpp b/dDatabase/Tables/CDBehaviorEffectTable.cpp new file mode 100644 index 0000000..c27634d --- /dev/null +++ b/dDatabase/Tables/CDBehaviorEffectTable.cpp @@ -0,0 +1,78 @@ +#include "CDBehaviorEffectTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.876159 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBehaviorEffectTable::CDBehaviorEffectTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BehaviorEffect"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorEffect"); + while (!tableData.eof()) { + CDBehaviorEffect entry; + entry.effectID = tableData.getIntField(0, int{}); + entry.effectType = tableData.getStringField(1, std::string{}.c_str()); + entry.effectName = tableData.getStringField(2, std::string{}.c_str()); + entry.trailID = tableData.getIntField(3, int{}); + entry.pcreateDuration = tableData.getFloatField(4, float{}); + entry.soundName = tableData.getStringField(5, std::string{}.c_str()); + entry.animationName = tableData.getStringField(6, std::string{}.c_str()); + entry.attachToObject = tableData.getIntField(7, bool{}); + entry.boneName = tableData.getStringField(8, std::string{}.c_str()); + entry.useSecondary = tableData.getIntField(9, bool{}); + entry.soundIs3D = tableData.getIntField(10, bool{}); + entry.cameraEffectType = tableData.getIntField(11, int{}); + entry.cameraDuration = tableData.getFloatField(12, float{}); + entry.cameraFrequency = tableData.getFloatField(13, float{}); + entry.cameraXAmp = tableData.getFloatField(14, float{}); + entry.cameraYAmp = tableData.getFloatField(15, float{}); + entry.cameraZAmp = tableData.getFloatField(16, float{}); + entry.cameraRotFrequency = tableData.getFloatField(17, float{}); + entry.cameraRoll = tableData.getFloatField(18, float{}); + entry.cameraPitch = tableData.getFloatField(19, float{}); + entry.cameraYaw = tableData.getFloatField(20, float{}); + entry.AudioEventGUID = tableData.getStringField(21, std::string{}.c_str()); + entry.renderEffectType = tableData.getIntField(22, int{}); + entry.renderEffectTime = tableData.getFloatField(23, float{}); + entry.renderStartVal = tableData.getFloatField(24, float{}); + entry.renderEndVal = tableData.getFloatField(25, float{}); + entry.renderDelayVal = tableData.getFloatField(26, float{}); + entry.renderValue1 = tableData.getFloatField(27, float{}); + entry.renderValue2 = tableData.getFloatField(28, float{}); + entry.renderValue3 = tableData.getFloatField(29, float{}); + entry.renderRGBA = tableData.getStringField(30, std::string{}.c_str()); + entry.renderShaderVal = tableData.getIntField(31, int{}); + entry.motionID = tableData.getIntField(32, int{}); + entry.meshID = tableData.getIntField(33, int{}); + entry.meshDuration = tableData.getFloatField(34, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDBehaviorEffectTable::~CDBehaviorEffectTable() { +} + +std::string CDBehaviorEffectTable::GetName(void) const { + return "BehaviorEffect"; +} + +std::vector CDBehaviorEffectTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDBehaviorEffectTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDBehaviorEffectTable.h b/dDatabase/Tables/CDBehaviorEffectTable.h new file mode 100644 index 0000000..1928de1 --- /dev/null +++ b/dDatabase/Tables/CDBehaviorEffectTable.h @@ -0,0 +1,55 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.874163 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDBehaviorEffect { + int effectID; + std::string effectType; + std::string effectName; + int trailID; + float pcreateDuration; + std::string soundName; + std::string animationName; + bool attachToObject; + std::string boneName; + bool useSecondary; + bool soundIs3D; + int cameraEffectType; + float cameraDuration; + float cameraFrequency; + float cameraXAmp; + float cameraYAmp; + float cameraZAmp; + float cameraRotFrequency; + float cameraRoll; + float cameraPitch; + float cameraYaw; + std::string AudioEventGUID; + int renderEffectType; + float renderEffectTime; + float renderStartVal; + float renderEndVal; + float renderDelayVal; + float renderValue1; + float renderValue2; + float renderValue3; + std::string renderRGBA; + int renderShaderVal; + int motionID; + int meshID; + float meshDuration; +}; + +class CDBehaviorEffectTable : public CDTable { +private: + std::vector m_entries; +public: + CDBehaviorEffectTable(); + ~CDBehaviorEffectTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDBehaviorParameterTable.cpp b/dDatabase/Tables/CDBehaviorParameterTable.cpp index ef26742..af37fc8 100644 --- a/dDatabase/Tables/CDBehaviorParameterTable.cpp +++ b/dDatabase/Tables/CDBehaviorParameterTable.cpp @@ -1,90 +1,47 @@ #include "CDBehaviorParameterTable.h" -#include "GeneralUtils.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.881145 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDBehaviorParameterTable::CDBehaviorParameterTable(void) { -#ifdef CDCLIENT_CACHE_ALL - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorParameter"); - while (!tableData.eof()) { - CDBehaviorParameter entry; - entry.behaviorID = tableData.getIntField(0, -1); - entry.parameterID = tableData.getStringField(1, ""); - entry.value = tableData.getFloatField(2, -1.0f); +CDBehaviorParameterTable::CDBehaviorParameterTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BehaviorParameter"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } - //Check if we have an entry with this ID: - auto it = m_entries.find(entry.behaviorID); - if (it != m_entries.end()) { - it->second.insert(std::make_pair(entry.parameterID, entry.value)); - } - else { - //Otherwise, insert it: - m_entries.insert(std::make_pair(entry.behaviorID, std::map())); - auto jit = m_entries.find(entry.behaviorID); + tableSize.finalize(); + this->m_entries.reserve(size); - //Add our value as well: - jit->second.insert(std::make_pair(entry.parameterID, entry.value)); - } - - tableData.nextRow(); - } + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorParameter"); + while (!tableData.eof()) { + CDBehaviorParameter entry; + entry.behaviorID = tableData.getIntField(0, int{}); + entry.parameterID = tableData.getStringField(1, std::string{}.c_str()); + entry.value = tableData.getFloatField(2, float{}); + entry._internalSkillID = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); -#endif } -//! Destructor -CDBehaviorParameterTable::~CDBehaviorParameterTable(void) { } +CDBehaviorParameterTable::~CDBehaviorParameterTable() { +} -//! Returns the table's name std::string CDBehaviorParameterTable::GetName(void) const { - return "BehaviorParameter"; + return "BehaviorParameter"; } -float CDBehaviorParameterTable::GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue) -{ - size_t hash = 0; - GeneralUtils::hash_combine(hash, behaviorID); - GeneralUtils::hash_combine(hash, name); +std::vector CDBehaviorParameterTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); - // Search for specific parameter - const auto& it = m_Entries.find(hash); - if (it != m_Entries.end()) { - return it->second; - } - - // Check if this behavior has already been checked - const auto& itChecked = m_Entries.find(behaviorID); - if (itChecked != m_Entries.end()) { - return defaultValue; - } - -#ifndef CDCLIENT_CACHE_ALL - std::stringstream query; - - query << "SELECT parameterID, value FROM BehaviorParameter WHERE behaviorID = " << std::to_string(behaviorID); - - auto tableData = CDClientDatabase::ExecuteQuery(query.str()); - - m_Entries.insert_or_assign(behaviorID, 0); - - while (!tableData.eof()) { - const std::string parameterID = tableData.getStringField(0, ""); - const float value = tableData.getFloatField(1, 0); - - size_t parameterHash = 0; - GeneralUtils::hash_combine(parameterHash, behaviorID); - GeneralUtils::hash_combine(parameterHash, parameterID); - - m_Entries.insert_or_assign(parameterHash, value); - - tableData.nextRow(); - } - - const auto& it2 = m_Entries.find(hash); - if (it2 != m_Entries.end()) { - return it2->second; - } -#endif - - return defaultValue; + return data; +} + +std::vector CDBehaviorParameterTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDBehaviorParameterTable.h b/dDatabase/Tables/CDBehaviorParameterTable.h index 3d14d66..e816a86 100644 --- a/dDatabase/Tables/CDBehaviorParameterTable.h +++ b/dDatabase/Tables/CDBehaviorParameterTable.h @@ -1,39 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -#include -/*! - \file CDBehaviorParameterTable.hpp - \brief Contains data for the BehaviorParameter table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.879169 +//DO NOT EDIT THIS FILE MANUALLY! -//! BehaviorParameter Entry Struct struct CDBehaviorParameter { - unsigned int behaviorID; //!< The Behavior ID - std::string parameterID; //!< The Parameter ID - float value; //!< The value of the behavior template + int behaviorID; + std::string parameterID; + float value; + int _internalSkillID; }; -//! BehaviorParameter table class CDBehaviorParameterTable : public CDTable { private: - std::map m_Entries; - + std::vector m_entries; public: - - //! Constructor - CDBehaviorParameterTable(void); - - //! Destructor - ~CDBehaviorParameterTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - float GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0); + CDBehaviorParameterTable(); + ~CDBehaviorParameterTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDBehaviorTemplateNameTable.cpp b/dDatabase/Tables/CDBehaviorTemplateNameTable.cpp new file mode 100644 index 0000000..3248a9f --- /dev/null +++ b/dDatabase/Tables/CDBehaviorTemplateNameTable.cpp @@ -0,0 +1,45 @@ +#include "CDBehaviorTemplateNameTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.888126 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBehaviorTemplateNameTable::CDBehaviorTemplateNameTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BehaviorTemplateName"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorTemplateName"); + while (!tableData.eof()) { + CDBehaviorTemplateName entry; + entry.templateID = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDBehaviorTemplateNameTable::~CDBehaviorTemplateNameTable() { +} + +std::string CDBehaviorTemplateNameTable::GetName(void) const { + return "BehaviorTemplateName"; +} + +std::vector CDBehaviorTemplateNameTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDBehaviorTemplateNameTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDBehaviorTemplateNameTable.h b/dDatabase/Tables/CDBehaviorTemplateNameTable.h new file mode 100644 index 0000000..1627bfb --- /dev/null +++ b/dDatabase/Tables/CDBehaviorTemplateNameTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.887128 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDBehaviorTemplateName { + int templateID; + std::string name; +}; + +class CDBehaviorTemplateNameTable : public CDTable { +private: + std::vector m_entries; +public: + CDBehaviorTemplateNameTable(); + ~CDBehaviorTemplateNameTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDBehaviorTemplateTable.cpp b/dDatabase/Tables/CDBehaviorTemplateTable.cpp index f983031..edcaf8c 100644 --- a/dDatabase/Tables/CDBehaviorTemplateTable.cpp +++ b/dDatabase/Tables/CDBehaviorTemplateTable.cpp @@ -1,57 +1,47 @@ #include "CDBehaviorTemplateTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.885134 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBehaviorTemplateTable::CDBehaviorTemplateTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BehaviorTemplate"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDBehaviorTemplateTable::CDBehaviorTemplateTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BehaviorTemplate"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorTemplate"); - while (!tableData.eof()) { - CDBehaviorTemplate entry; - entry.behaviorID = tableData.getIntField(0, -1); - entry.templateID = tableData.getIntField(1, -1); - entry.effectID = tableData.getIntField(2, -1); - entry.effectHandle = tableData.getStringField(3, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BehaviorTemplate"); + while (!tableData.eof()) { + CDBehaviorTemplate entry; + entry.behaviorID = tableData.getIntField(0, int{}); + entry.templateID = tableData.getIntField(1, int{}); + entry.effectID = tableData.getIntField(2, int{}); + entry.effectHandle = tableData.getStringField(3, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDBehaviorTemplateTable::~CDBehaviorTemplateTable(void) { } +CDBehaviorTemplateTable::~CDBehaviorTemplateTable() { +} -//! Returns the table's name std::string CDBehaviorTemplateTable::GetName(void) const { - return "BehaviorTemplate"; + return "BehaviorTemplate"; } -//! Queries the table with a custom "where" clause std::vector CDBehaviorTemplateTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDBehaviorTemplateTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDBehaviorTemplateTable.h b/dDatabase/Tables/CDBehaviorTemplateTable.h index a63c216..e7bb430 100644 --- a/dDatabase/Tables/CDBehaviorTemplateTable.h +++ b/dDatabase/Tables/CDBehaviorTemplateTable.h @@ -1,51 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDBehaviorTemplateTable.hpp - \brief Contains data for the BehaviorTemplate table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.884137 +//DO NOT EDIT THIS FILE MANUALLY! -//! BehaviorTemplate Entry Struct struct CDBehaviorTemplate { - unsigned int behaviorID; //!< The Behavior ID - unsigned int templateID; //!< The Template ID (LOT) - unsigned int effectID; //!< The Effect ID attached - std::string effectHandle; //!< The effect handle + int behaviorID; + int templateID; + int effectID; + std::string effectHandle; }; - -//! BehaviorTemplate table class CDBehaviorTemplateTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDBehaviorTemplateTable(void); - - //! Destructor - ~CDBehaviorTemplateTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDBehaviorTemplateTable(); + ~CDBehaviorTemplateTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDBlueprintsTable.cpp b/dDatabase/Tables/CDBlueprintsTable.cpp new file mode 100644 index 0000000..20fb7a5 --- /dev/null +++ b/dDatabase/Tables/CDBlueprintsTable.cpp @@ -0,0 +1,55 @@ +#include "CDBlueprintsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.893113 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBlueprintsTable::CDBlueprintsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Blueprints"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Blueprints"); + while (!tableData.eof()) { + CDBlueprints entry; + entry.id = tableData.getInt64Field(0, uint64_t{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + entry.description = tableData.getStringField(2, std::string{}.c_str()); + entry.accountid = tableData.getInt64Field(3, uint64_t{}); + entry.characterid = tableData.getInt64Field(4, uint64_t{}); + entry.price = tableData.getIntField(5, int{}); + entry.rating = tableData.getIntField(6, int{}); + entry.categoryid = tableData.getIntField(7, int{}); + entry.lxfpath = tableData.getStringField(8, std::string{}.c_str()); + entry.deleted = tableData.getIntField(9, bool{}); + entry.created = tableData.getStringField(10, std::string{}.c_str()); + entry.modified = tableData.getStringField(11, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDBlueprintsTable::~CDBlueprintsTable() { +} + +std::string CDBlueprintsTable::GetName(void) const { + return "Blueprints"; +} + +std::vector CDBlueprintsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDBlueprintsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDBlueprintsTable.h b/dDatabase/Tables/CDBlueprintsTable.h new file mode 100644 index 0000000..b06a767 --- /dev/null +++ b/dDatabase/Tables/CDBlueprintsTable.h @@ -0,0 +1,32 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.892149 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDBlueprints { + uint64_t id; + std::string name; + std::string description; + uint64_t accountid; + uint64_t characterid; + int price; + int rating; + int categoryid; + std::string lxfpath; + bool deleted; + std::string created; + std::string modified; +}; + +class CDBlueprintsTable : public CDTable { +private: + std::vector m_entries; +public: + CDBlueprintsTable(); + ~CDBlueprintsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDBrickColorsTable.cpp b/dDatabase/Tables/CDBrickColorsTable.cpp new file mode 100644 index 0000000..0a8658f --- /dev/null +++ b/dDatabase/Tables/CDBrickColorsTable.cpp @@ -0,0 +1,53 @@ +#include "CDBrickColorsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.901091 +//DO NOT EDIT THIS FILE MANUALLY! + +CDBrickColorsTable::CDBrickColorsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BrickColors"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BrickColors"); + while (!tableData.eof()) { + CDBrickColors entry; + entry.id = tableData.getIntField(0, int{}); + entry.red = tableData.getFloatField(1, float{}); + entry.green = tableData.getFloatField(2, float{}); + entry.blue = tableData.getFloatField(3, float{}); + entry.alpha = tableData.getFloatField(4, float{}); + entry.legopaletteid = tableData.getIntField(5, int{}); + entry.description = tableData.getStringField(6, std::string{}.c_str()); + entry.validTypes = tableData.getIntField(7, int{}); + entry.validCharacters = tableData.getIntField(8, int{}); + entry.factoryValid = tableData.getIntField(9, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDBrickColorsTable::~CDBrickColorsTable() { +} + +std::string CDBrickColorsTable::GetName(void) const { + return "BrickColors"; +} + +std::vector CDBrickColorsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDBrickColorsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDBrickColorsTable.h b/dDatabase/Tables/CDBrickColorsTable.h new file mode 100644 index 0000000..335a7d3 --- /dev/null +++ b/dDatabase/Tables/CDBrickColorsTable.h @@ -0,0 +1,30 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.900094 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDBrickColors { + int id; + float red; + float green; + float blue; + float alpha; + int legopaletteid; + std::string description; + int validTypes; + int validCharacters; + bool factoryValid; +}; + +class CDBrickColorsTable : public CDTable { +private: + std::vector m_entries; +public: + CDBrickColorsTable(); + ~CDBrickColorsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDBrickIDTableTable.cpp b/dDatabase/Tables/CDBrickIDTableTable.cpp index a3fc860..0fd0c5f 100644 --- a/dDatabase/Tables/CDBrickIDTableTable.cpp +++ b/dDatabase/Tables/CDBrickIDTableTable.cpp @@ -1,55 +1,45 @@ #include "CDBrickIDTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.904085 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDBrickIDTableTable::CDBrickIDTableTable(void) { - - // First, get the size of the table +CDBrickIDTableTable::CDBrickIDTableTable() { unsigned int size = 0; auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM BrickIDTable"); - while (!tableSize.eof()) { + while (!tableSize.eof()) { size = tableSize.getIntField(0, 0); - tableSize.nextRow(); } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - // Now get the data + tableSize.finalize(); + this->m_entries.reserve(size); + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM BrickIDTable"); while (!tableData.eof()) { CDBrickIDTable entry; - entry.NDObjectID = tableData.getIntField(0, -1); - entry.LEGOBrickID = tableData.getIntField(1, -1); - - this->entries.push_back(entry); + entry.NDObjectID = tableData.getIntField(0, int{}); + entry.LEGOBrickID = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); tableData.nextRow(); } tableData.finalize(); } -//! Destructor -CDBrickIDTableTable::~CDBrickIDTableTable(void) { } +CDBrickIDTableTable::~CDBrickIDTableTable() { +} -//! Returns the table's name std::string CDBrickIDTableTable::GetName(void) const { return "BrickIDTable"; } -//! Queries the table with a custom "where" clause std::vector CDBrickIDTableTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) + std::vector data = cpplinq::from(this->m_entries) >> cpplinq::where(predicate) >> cpplinq::to_vector(); return data; } -//! Gets all the entries in the table std::vector CDBrickIDTableTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDBrickIDTableTable.h b/dDatabase/Tables/CDBrickIDTableTable.h index aefe332..37564c7 100644 --- a/dDatabase/Tables/CDBrickIDTableTable.h +++ b/dDatabase/Tables/CDBrickIDTableTable.h @@ -1,49 +1,22 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDBrickIDTableTable.hpp - \brief Contains data for the BrickIDTable table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.903102 +//DO NOT EDIT THIS FILE MANUALLY! - //! BrickIDTable Entry Struct struct CDBrickIDTable { - unsigned int NDObjectID; - unsigned int LEGOBrickID; + int NDObjectID; + int LEGOBrickID; }; - -//! BrickIDTable table class CDBrickIDTableTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDBrickIDTableTable(void); - - //! Destructor - ~CDBrickIDTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ + CDBrickIDTableTable(); + ~CDBrickIDTableTable(); std::string GetName(void) const override; - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ +std::vector Query(std::function predicate); std::vector GetEntries(void) const; - }; diff --git a/dDatabase/Tables/CDCameraTable.cpp b/dDatabase/Tables/CDCameraTable.cpp new file mode 100644 index 0000000..3478cc8 --- /dev/null +++ b/dDatabase/Tables/CDCameraTable.cpp @@ -0,0 +1,103 @@ +#include "CDCameraTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.908279 +//DO NOT EDIT THIS FILE MANUALLY! + +CDCameraTable::CDCameraTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Camera"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Camera"); + while (!tableData.eof()) { + CDCamera entry; + entry.camera_name = tableData.getStringField(0, std::string{}.c_str()); + entry.pitch_angle_tolerance = tableData.getFloatField(1, float{}); + entry.starting_zoom = tableData.getFloatField(2, float{}); + entry.zoom_return_modifier = tableData.getFloatField(3, float{}); + entry.pitch_return_modifier = tableData.getFloatField(4, float{}); + entry.tether_out_return_modifier = tableData.getFloatField(5, float{}); + entry.tether_in_return_multiplier = tableData.getFloatField(6, float{}); + entry.verticle_movement_dampening_modifier = tableData.getFloatField(7, float{}); + entry.return_from_incline_modifier = tableData.getFloatField(8, float{}); + entry.horizontal_return_modifier = tableData.getFloatField(9, float{}); + entry.yaw_behavior_speed_multiplier = tableData.getFloatField(10, float{}); + entry.camera_collision_padding = tableData.getFloatField(11, float{}); + entry.glide_speed = tableData.getFloatField(12, float{}); + entry.fade_player_min_range = tableData.getFloatField(13, float{}); + entry.min_movement_delta_tolerance = tableData.getFloatField(14, float{}); + entry.min_glide_distance_tolerance = tableData.getFloatField(15, float{}); + entry.look_forward_offset = tableData.getFloatField(16, float{}); + entry.look_up_offset = tableData.getFloatField(17, float{}); + entry.minimum_vertical_dampening_distance = tableData.getFloatField(18, float{}); + entry.maximum_vertical_dampening_distance = tableData.getFloatField(19, float{}); + entry.minimum_ignore_jump_distance = tableData.getFloatField(20, float{}); + entry.maximum_ignore_jump_distance = tableData.getFloatField(21, float{}); + entry.maximum_auto_glide_angle = tableData.getFloatField(22, float{}); + entry.minimum_tether_glide_distance = tableData.getFloatField(23, float{}); + entry.yaw_sign_correction = tableData.getFloatField(24, float{}); + entry.set_1_look_forward_offset = tableData.getFloatField(25, float{}); + entry.set_1_look_up_offset = tableData.getFloatField(26, float{}); + entry.set_2_look_forward_offset = tableData.getFloatField(27, float{}); + entry.set_2_look_up_offset = tableData.getFloatField(28, float{}); + entry.set_0_speed_influence_on_dir = tableData.getFloatField(29, float{}); + entry.set_1_speed_influence_on_dir = tableData.getFloatField(30, float{}); + entry.set_2_speed_influence_on_dir = tableData.getFloatField(31, float{}); + entry.set_0_angular_relaxation = tableData.getFloatField(32, float{}); + entry.set_1_angular_relaxation = tableData.getFloatField(33, float{}); + entry.set_2_angular_relaxation = tableData.getFloatField(34, float{}); + entry.set_0_position_up_offset = tableData.getFloatField(35, float{}); + entry.set_1_position_up_offset = tableData.getFloatField(36, float{}); + entry.set_2_position_up_offset = tableData.getFloatField(37, float{}); + entry.set_0_position_forward_offset = tableData.getFloatField(38, float{}); + entry.set_1_position_forward_offset = tableData.getFloatField(39, float{}); + entry.set_2_position_forward_offset = tableData.getFloatField(40, float{}); + entry.set_0_FOV = tableData.getFloatField(41, float{}); + entry.set_1_FOV = tableData.getFloatField(42, float{}); + entry.set_2_FOV = tableData.getFloatField(43, float{}); + entry.set_0_max_yaw_angle = tableData.getFloatField(44, float{}); + entry.set_1_max_yaw_angle = tableData.getFloatField(45, float{}); + entry.set_2_max_yaw_angle = tableData.getFloatField(46, float{}); + entry.set_1_fade_in_camera_set_change = tableData.getIntField(47, int{}); + entry.set_1_fade_out_camera_set_change = tableData.getIntField(48, int{}); + entry.set_2_fade_in_camera_set_change = tableData.getIntField(49, int{}); + entry.set_2_fade_out_camera_set_change = tableData.getIntField(50, int{}); + entry.input_movement_scalar = tableData.getFloatField(51, float{}); + entry.input_rotation_scalar = tableData.getFloatField(52, float{}); + entry.input_zoom_scalar = tableData.getFloatField(53, float{}); + entry.minimum_pitch_desired = tableData.getFloatField(54, float{}); + entry.maximum_pitch_desired = tableData.getFloatField(55, float{}); + entry.minimum_zoom = tableData.getFloatField(56, float{}); + entry.maximum_zoom = tableData.getFloatField(57, float{}); + entry.horizontal_rotate_tolerance = tableData.getFloatField(58, float{}); + entry.horizontal_rotate_modifier = tableData.getFloatField(59, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDCameraTable::~CDCameraTable() { +} + +std::string CDCameraTable::GetName(void) const { + return "Camera"; +} + +std::vector CDCameraTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDCameraTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDCameraTable.h b/dDatabase/Tables/CDCameraTable.h new file mode 100644 index 0000000..77a5d79 --- /dev/null +++ b/dDatabase/Tables/CDCameraTable.h @@ -0,0 +1,80 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.907075 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDCamera { + std::string camera_name; + float pitch_angle_tolerance; + float starting_zoom; + float zoom_return_modifier; + float pitch_return_modifier; + float tether_out_return_modifier; + float tether_in_return_multiplier; + float verticle_movement_dampening_modifier; + float return_from_incline_modifier; + float horizontal_return_modifier; + float yaw_behavior_speed_multiplier; + float camera_collision_padding; + float glide_speed; + float fade_player_min_range; + float min_movement_delta_tolerance; + float min_glide_distance_tolerance; + float look_forward_offset; + float look_up_offset; + float minimum_vertical_dampening_distance; + float maximum_vertical_dampening_distance; + float minimum_ignore_jump_distance; + float maximum_ignore_jump_distance; + float maximum_auto_glide_angle; + float minimum_tether_glide_distance; + float yaw_sign_correction; + float set_1_look_forward_offset; + float set_1_look_up_offset; + float set_2_look_forward_offset; + float set_2_look_up_offset; + float set_0_speed_influence_on_dir; + float set_1_speed_influence_on_dir; + float set_2_speed_influence_on_dir; + float set_0_angular_relaxation; + float set_1_angular_relaxation; + float set_2_angular_relaxation; + float set_0_position_up_offset; + float set_1_position_up_offset; + float set_2_position_up_offset; + float set_0_position_forward_offset; + float set_1_position_forward_offset; + float set_2_position_forward_offset; + float set_0_FOV; + float set_1_FOV; + float set_2_FOV; + float set_0_max_yaw_angle; + float set_1_max_yaw_angle; + float set_2_max_yaw_angle; + int set_1_fade_in_camera_set_change; + int set_1_fade_out_camera_set_change; + int set_2_fade_in_camera_set_change; + int set_2_fade_out_camera_set_change; + float input_movement_scalar; + float input_rotation_scalar; + float input_zoom_scalar; + float minimum_pitch_desired; + float maximum_pitch_desired; + float minimum_zoom; + float maximum_zoom; + float horizontal_rotate_tolerance; + float horizontal_rotate_modifier; +}; + +class CDCameraTable : public CDTable { +private: + std::vector m_entries; +public: + CDCameraTable(); + ~CDCameraTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDChoiceBuildComponentTable.cpp b/dDatabase/Tables/CDChoiceBuildComponentTable.cpp new file mode 100644 index 0000000..640f7c3 --- /dev/null +++ b/dDatabase/Tables/CDChoiceBuildComponentTable.cpp @@ -0,0 +1,46 @@ +#include "CDChoiceBuildComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.913060 +//DO NOT EDIT THIS FILE MANUALLY! + +CDChoiceBuildComponentTable::CDChoiceBuildComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ChoiceBuildComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ChoiceBuildComponent"); + while (!tableData.eof()) { + CDChoiceBuildComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.selections = tableData.getStringField(1, std::string{}.c_str()); + entry.imaginationOverride = tableData.getIntField(2, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDChoiceBuildComponentTable::~CDChoiceBuildComponentTable() { +} + +std::string CDChoiceBuildComponentTable::GetName(void) const { + return "ChoiceBuildComponent"; +} + +std::vector CDChoiceBuildComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDChoiceBuildComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDChoiceBuildComponentTable.h b/dDatabase/Tables/CDChoiceBuildComponentTable.h new file mode 100644 index 0000000..790eacc --- /dev/null +++ b/dDatabase/Tables/CDChoiceBuildComponentTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.912062 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDChoiceBuildComponent { + int id; + std::string selections; + int imaginationOverride; +}; + +class CDChoiceBuildComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDChoiceBuildComponentTable(); + ~CDChoiceBuildComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDCollectibleComponentTable.cpp b/dDatabase/Tables/CDCollectibleComponentTable.cpp new file mode 100644 index 0000000..ba29b8a --- /dev/null +++ b/dDatabase/Tables/CDCollectibleComponentTable.cpp @@ -0,0 +1,45 @@ +#include "CDCollectibleComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.920051 +//DO NOT EDIT THIS FILE MANUALLY! + +CDCollectibleComponentTable::CDCollectibleComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CollectibleComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CollectibleComponent"); + while (!tableData.eof()) { + CDCollectibleComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.requirement_mission = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDCollectibleComponentTable::~CDCollectibleComponentTable() { +} + +std::string CDCollectibleComponentTable::GetName(void) const { + return "CollectibleComponent"; +} + +std::vector CDCollectibleComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDCollectibleComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDCollectibleComponentTable.h b/dDatabase/Tables/CDCollectibleComponentTable.h new file mode 100644 index 0000000..0256d9b --- /dev/null +++ b/dDatabase/Tables/CDCollectibleComponentTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.917049 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDCollectibleComponent { + int id; + int requirement_mission; +}; + +class CDCollectibleComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDCollectibleComponentTable(); + ~CDCollectibleComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDComponentsRegistryTable.cpp b/dDatabase/Tables/CDComponentsRegistryTable.cpp index 7e746fb..fb083cc 100644 --- a/dDatabase/Tables/CDComponentsRegistryTable.cpp +++ b/dDatabase/Tables/CDComponentsRegistryTable.cpp @@ -1,131 +1,46 @@ #include "CDComponentsRegistryTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.923033 +//DO NOT EDIT THIS FILE MANUALLY! -#define CDCLIENT_CACHE_ALL +CDComponentsRegistryTable::CDComponentsRegistryTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ComponentsRegistry"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDComponentsRegistryTable::CDComponentsRegistryTable(void) { - -#ifdef CDCLIENT_CACHE_ALL - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ComponentsRegistry"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - //this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ComponentsRegistry"); - while (!tableData.eof()) { - CDComponentsRegistry entry; - entry.id = tableData.getIntField(0, -1); - entry.component_type = tableData.getIntField(1, -1); - entry.component_id = tableData.getIntField(2, -1); + this->m_entries.reserve(size); - this->mappedEntries.insert_or_assign(((uint64_t) entry.component_type) << 32 | ((uint64_t) entry.id), entry.component_id); - - //this->entries.push_back(entry); - - /* - //Darwin's stuff: - const auto& it = this->mappedEntries.find(entry.id); - if (it != mappedEntries.end()) { - const auto& iter = it->second.find(entry.component_type); - if (iter == it->second.end()) { - it->second.insert(std::make_pair(entry.component_type, entry.component_id)); - } - } - else { - std::map map; - map.insert(std::make_pair(entry.component_type, entry.component_id)); - this->mappedEntries.insert(std::make_pair(entry.id, map)); - } - */ - - tableData.nextRow(); - } + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ComponentsRegistry"); + while (!tableData.eof()) { + CDComponentsRegistry entry; + entry.id = tableData.getIntField(0, int{}); + entry.component_type = tableData.getIntField(1, int{}); + entry.component_id = tableData.getIntField(2, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); -#endif } -//! Destructor -CDComponentsRegistryTable::~CDComponentsRegistryTable(void) { } +CDComponentsRegistryTable::~CDComponentsRegistryTable() { +} -//! Returns the table's name std::string CDComponentsRegistryTable::GetName(void) const { - return "ComponentsRegistry"; + return "ComponentsRegistry"; } -int32_t CDComponentsRegistryTable::GetByIDAndType(uint32_t id, uint32_t componentType, int32_t defaultValue) -{ - const auto& iter = this->mappedEntries.find(((uint64_t) componentType) << 32 | ((uint64_t) id)); +std::vector CDComponentsRegistryTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); - if (iter == this->mappedEntries.end()) - { - return defaultValue; - } - - return iter->second; - - /* - const auto& it = this->mappedEntries.find(id); - if (it != mappedEntries.end()) { - const auto& iter = it->second.find(componentType); - if (iter != it->second.end()) { - return iter->second; - } - } - */ - -#ifndef CDCLIENT_CACHE_ALL - // Now get the data - std::stringstream query; - - query << "SELECT * FROM ComponentsRegistry WHERE id = " << std::to_string(id); - - auto tableData = CDClientDatabase::ExecuteQuery(query.str()); - while (!tableData.eof()) { - CDComponentsRegistry entry; - entry.id = tableData.getIntField(0, -1); - entry.component_type = tableData.getIntField(1, -1); - entry.component_id = tableData.getIntField(2, -1); - - //this->entries.push_back(entry); - - //Darwin's stuff: - const auto& it = this->mappedEntries.find(entry.id); - if (it != mappedEntries.end()) { - const auto& iter = it->second.find(entry.component_type); - if (iter == it->second.end()) { - it->second.insert(std::make_pair(entry.component_type, entry.component_id)); - } - } - else { - std::map map; - map.insert(std::make_pair(entry.component_type, entry.component_id)); - this->mappedEntries.insert(std::make_pair(entry.id, map)); - } - - tableData.nextRow(); - } - - tableData.finalize(); - - const auto& it2 = this->mappedEntries.find(id); - if (it2 != mappedEntries.end()) { - const auto& iter = it2->second.find(componentType); - if (iter != it2->second.end()) { - return iter->second; - } - } - - return defaultValue; -#endif + return data; +} + +std::vector CDComponentsRegistryTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDComponentsRegistryTable.h b/dDatabase/Tables/CDComponentsRegistryTable.h index 4a02bf9..f85a9a3 100644 --- a/dDatabase/Tables/CDComponentsRegistryTable.h +++ b/dDatabase/Tables/CDComponentsRegistryTable.h @@ -1,40 +1,23 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDComponentsRegistryTable.hpp - \brief Contains data for the ComponentsRegistry table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.922038 +//DO NOT EDIT THIS FILE MANUALLY! -//! ComponentsRegistry Entry Struct struct CDComponentsRegistry { - unsigned int id; //!< The LOT is used as the ID - unsigned int component_type; //!< See ComponentTypes enum for values - unsigned int component_id; //!< The ID used within the component's table (0 may either mean it's non-networked, or that the ID is actually 0 + int id; + int component_type; + int component_id; }; - -//! ComponentsRegistry table class CDComponentsRegistryTable : public CDTable { private: - //std::vector entries; - std::map mappedEntries; //id, component_type, component_id - + std::vector m_entries; public: - - //! Constructor - CDComponentsRegistryTable(void); - - //! Destructor - ~CDComponentsRegistryTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; + CDComponentsRegistryTable(); + ~CDComponentsRegistryTable(); + std::string GetName(void) const override; - int32_t GetByIDAndType(uint32_t id, uint32_t componentType, int32_t defaultValue = 0); +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDControlSchemesTable.cpp b/dDatabase/Tables/CDControlSchemesTable.cpp new file mode 100644 index 0000000..4530f44 --- /dev/null +++ b/dDatabase/Tables/CDControlSchemesTable.cpp @@ -0,0 +1,68 @@ +#include "CDControlSchemesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.927075 +//DO NOT EDIT THIS FILE MANUALLY! + +CDControlSchemesTable::CDControlSchemesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ControlSchemes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ControlSchemes"); + while (!tableData.eof()) { + CDControlSchemes entry; + entry.control_scheme = tableData.getIntField(0, int{}); + entry.scheme_name = tableData.getStringField(1, std::string{}.c_str()); + entry.rotation_speed = tableData.getFloatField(2, float{}); + entry.walk_forward_speed = tableData.getFloatField(3, float{}); + entry.walk_backward_speed = tableData.getFloatField(4, float{}); + entry.walk_strafe_speed = tableData.getFloatField(5, float{}); + entry.walk_strafe_forward_speed = tableData.getFloatField(6, float{}); + entry.walk_strafe_backward_speed = tableData.getFloatField(7, float{}); + entry.run_backward_speed = tableData.getFloatField(8, float{}); + entry.run_strafe_speed = tableData.getFloatField(9, float{}); + entry.run_strafe_forward_speed = tableData.getFloatField(10, float{}); + entry.run_strafe_backward_speed = tableData.getFloatField(11, float{}); + entry.keyboard_zoom_sensitivity = tableData.getFloatField(12, float{}); + entry.keyboard_pitch_sensitivity = tableData.getFloatField(13, float{}); + entry.keyboard_yaw_sensitivity = tableData.getFloatField(14, float{}); + entry.mouse_zoom_wheel_sensitivity = tableData.getFloatField(15, float{}); + entry.x_mouse_move_sensitivity_modifier = tableData.getFloatField(16, float{}); + entry.y_mouse_move_sensitivity_modifier = tableData.getFloatField(17, float{}); + entry.freecam_speed_modifier = tableData.getFloatField(18, float{}); + entry.freecam_slow_speed_multiplier = tableData.getFloatField(19, float{}); + entry.freecam_fast_speed_multiplier = tableData.getFloatField(20, float{}); + entry.freecam_mouse_modifier = tableData.getFloatField(21, float{}); + entry.gamepad_pitch_rot_sensitivity = tableData.getFloatField(22, float{}); + entry.gamepad_yaw_rot_sensitivity = tableData.getFloatField(23, float{}); + entry.gamepad_trigger_sensitivity = tableData.getFloatField(24, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDControlSchemesTable::~CDControlSchemesTable() { +} + +std::string CDControlSchemesTable::GetName(void) const { + return "ControlSchemes"; +} + +std::vector CDControlSchemesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDControlSchemesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDControlSchemesTable.h b/dDatabase/Tables/CDControlSchemesTable.h new file mode 100644 index 0000000..887611f --- /dev/null +++ b/dDatabase/Tables/CDControlSchemesTable.h @@ -0,0 +1,45 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.925028 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDControlSchemes { + int control_scheme; + std::string scheme_name; + float rotation_speed; + float walk_forward_speed; + float walk_backward_speed; + float walk_strafe_speed; + float walk_strafe_forward_speed; + float walk_strafe_backward_speed; + float run_backward_speed; + float run_strafe_speed; + float run_strafe_forward_speed; + float run_strafe_backward_speed; + float keyboard_zoom_sensitivity; + float keyboard_pitch_sensitivity; + float keyboard_yaw_sensitivity; + float mouse_zoom_wheel_sensitivity; + float x_mouse_move_sensitivity_modifier; + float y_mouse_move_sensitivity_modifier; + float freecam_speed_modifier; + float freecam_slow_speed_multiplier; + float freecam_fast_speed_multiplier; + float freecam_mouse_modifier; + float gamepad_pitch_rot_sensitivity; + float gamepad_yaw_rot_sensitivity; + float gamepad_trigger_sensitivity; +}; + +class CDControlSchemesTable : public CDTable { +private: + std::vector m_entries; +public: + CDControlSchemesTable(); + ~CDControlSchemesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDCurrencyDenominationsTable.cpp b/dDatabase/Tables/CDCurrencyDenominationsTable.cpp new file mode 100644 index 0000000..f977aef --- /dev/null +++ b/dDatabase/Tables/CDCurrencyDenominationsTable.cpp @@ -0,0 +1,45 @@ +#include "CDCurrencyDenominationsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.934003 +//DO NOT EDIT THIS FILE MANUALLY! + +CDCurrencyDenominationsTable::CDCurrencyDenominationsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyDenominations"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyDenominations"); + while (!tableData.eof()) { + CDCurrencyDenominations entry; + entry.value = tableData.getIntField(0, int{}); + entry.objectid = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDCurrencyDenominationsTable::~CDCurrencyDenominationsTable() { +} + +std::string CDCurrencyDenominationsTable::GetName(void) const { + return "CurrencyDenominations"; +} + +std::vector CDCurrencyDenominationsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDCurrencyDenominationsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDCurrencyDenominationsTable.h b/dDatabase/Tables/CDCurrencyDenominationsTable.h new file mode 100644 index 0000000..6f56697 --- /dev/null +++ b/dDatabase/Tables/CDCurrencyDenominationsTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.933006 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDCurrencyDenominations { + int value; + int objectid; +}; + +class CDCurrencyDenominationsTable : public CDTable { +private: + std::vector m_entries; +public: + CDCurrencyDenominationsTable(); + ~CDCurrencyDenominationsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDCurrencyIndexTable.cpp b/dDatabase/Tables/CDCurrencyIndexTable.cpp new file mode 100644 index 0000000..633f9d2 --- /dev/null +++ b/dDatabase/Tables/CDCurrencyIndexTable.cpp @@ -0,0 +1,45 @@ +#include "CDCurrencyIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.936996 +//DO NOT EDIT THIS FILE MANUALLY! + +CDCurrencyIndexTable::CDCurrencyIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyIndex"); + while (!tableData.eof()) { + CDCurrencyIndex entry; + entry.CurrencyIndex = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDCurrencyIndexTable::~CDCurrencyIndexTable() { +} + +std::string CDCurrencyIndexTable::GetName(void) const { + return "CurrencyIndex"; +} + +std::vector CDCurrencyIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDCurrencyIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDCurrencyIndexTable.h b/dDatabase/Tables/CDCurrencyIndexTable.h new file mode 100644 index 0000000..f458820 --- /dev/null +++ b/dDatabase/Tables/CDCurrencyIndexTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.935999 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDCurrencyIndex { + int CurrencyIndex; + std::string description; +}; + +class CDCurrencyIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDCurrencyIndexTable(); + ~CDCurrencyIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDCurrencyTableTable.cpp b/dDatabase/Tables/CDCurrencyTableTable.cpp index cfe26e7..35fd6cc 100644 --- a/dDatabase/Tables/CDCurrencyTableTable.cpp +++ b/dDatabase/Tables/CDCurrencyTableTable.cpp @@ -1,58 +1,48 @@ #include "CDCurrencyTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.944043 +//DO NOT EDIT THIS FILE MANUALLY! + +CDCurrencyTableTable::CDCurrencyTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDCurrencyTableTable::CDCurrencyTableTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM CurrencyTable"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyTable"); - while (!tableData.eof()) { - CDCurrencyTable entry; - entry.currencyIndex = tableData.getIntField(0, -1); - entry.npcminlevel = tableData.getIntField(1, -1); - entry.minvalue = tableData.getIntField(2, -1); - entry.maxvalue = tableData.getIntField(3, -1); - entry.id = tableData.getIntField(4, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM CurrencyTable"); + while (!tableData.eof()) { + CDCurrencyTable entry; + entry.currencyIndex = tableData.getIntField(0, int{}); + entry.npcminlevel = tableData.getIntField(1, int{}); + entry.minvalue = tableData.getIntField(2, int{}); + entry.maxvalue = tableData.getIntField(3, int{}); + entry.id = tableData.getIntField(4, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDCurrencyTableTable::~CDCurrencyTableTable(void) { } +CDCurrencyTableTable::~CDCurrencyTableTable() { +} -//! Returns the table's name std::string CDCurrencyTableTable::GetName(void) const { - return "CurrencyTable"; + return "CurrencyTable"; } -//! Queries the table with a custom "where" clause std::vector CDCurrencyTableTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDCurrencyTableTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDCurrencyTableTable.h b/dDatabase/Tables/CDCurrencyTableTable.h index b980a18..2568f38 100644 --- a/dDatabase/Tables/CDCurrencyTableTable.h +++ b/dDatabase/Tables/CDCurrencyTableTable.h @@ -1,51 +1,25 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDCurrencyTableTable.hpp - \brief Contains data for the CurrencyTable table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.941997 +//DO NOT EDIT THIS FILE MANUALLY! -//! CurrencyTable Struct struct CDCurrencyTable { - unsigned int currencyIndex; //!< The Currency Index - unsigned int npcminlevel; //!< The minimum level of the npc - unsigned int minvalue; //!< The minimum currency - unsigned int maxvalue; //!< The maximum currency - unsigned int id; //!< The ID of the currency index + int currencyIndex; + int npcminlevel; + int minvalue; + int maxvalue; + int id; }; -//! CurrencyTable table class CDCurrencyTableTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDCurrencyTableTable(void); - - //! Destructor - ~CDCurrencyTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDCurrencyTableTable(); + ~CDCurrencyTableTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDDeletionRestrictionsTable.cpp b/dDatabase/Tables/CDDeletionRestrictionsTable.cpp new file mode 100644 index 0000000..ff62ca1 --- /dev/null +++ b/dDatabase/Tables/CDDeletionRestrictionsTable.cpp @@ -0,0 +1,47 @@ +#include "CDDeletionRestrictionsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.950958 +//DO NOT EDIT THIS FILE MANUALLY! + +CDDeletionRestrictionsTable::CDDeletionRestrictionsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM DeletionRestrictions"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DeletionRestrictions"); + while (!tableData.eof()) { + CDDeletionRestrictions entry; + entry.id = tableData.getIntField(0, int{}); + entry.restricted = tableData.getIntField(1, bool{}); + entry.ids = tableData.getStringField(2, std::string{}.c_str()); + entry.checkType = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDDeletionRestrictionsTable::~CDDeletionRestrictionsTable() { +} + +std::string CDDeletionRestrictionsTable::GetName(void) const { + return "DeletionRestrictions"; +} + +std::vector CDDeletionRestrictionsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDDeletionRestrictionsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDDeletionRestrictionsTable.h b/dDatabase/Tables/CDDeletionRestrictionsTable.h new file mode 100644 index 0000000..2135103 --- /dev/null +++ b/dDatabase/Tables/CDDeletionRestrictionsTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.948964 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDDeletionRestrictions { + int id; + bool restricted; + std::string ids; + int checkType; +}; + +class CDDeletionRestrictionsTable : public CDTable { +private: + std::vector m_entries; +public: + CDDeletionRestrictionsTable(); + ~CDDeletionRestrictionsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDDestructibleComponentTable.cpp b/dDatabase/Tables/CDDestructibleComponentTable.cpp index 6eb64e7..f3cf471 100644 --- a/dDatabase/Tables/CDDestructibleComponentTable.cpp +++ b/dDatabase/Tables/CDDestructibleComponentTable.cpp @@ -1,67 +1,58 @@ #include "CDDestructibleComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.955944 +//DO NOT EDIT THIS FILE MANUALLY! + +CDDestructibleComponentTable::CDDestructibleComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM DestructibleComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDDestructibleComponentTable::CDDestructibleComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM DestructibleComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DestructibleComponent"); - while (!tableData.eof()) { - CDDestructibleComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.faction = tableData.getIntField(1, -1); - entry.factionList = tableData.getStringField(2, ""); - entry.life = tableData.getIntField(3, -1); - entry.imagination = tableData.getIntField(4, -1); - entry.LootMatrixIndex = tableData.getIntField(5, -1); - entry.CurrencyIndex = tableData.getIntField(6, -1); - entry.level = tableData.getIntField(7, -1); - entry.armor = tableData.getFloatField(8, -1.0f); - entry.death_behavior = tableData.getIntField(9, -1); - entry.isnpc = tableData.getIntField(10, -1) == 1 ? true : false; - entry.attack_priority = tableData.getIntField(11, -1); - entry.isSmashable = tableData.getIntField(12, -1) == 1 ? true : false; - entry.difficultyLevel = tableData.getIntField(13, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DestructibleComponent"); + while (!tableData.eof()) { + CDDestructibleComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.faction = tableData.getIntField(1, int{}); + entry.life = tableData.getIntField(2, int{}); + entry.imagination = tableData.getIntField(3, int{}); + entry.LootMatrixIndex = tableData.getIntField(4, int{}); + entry.CurrencyIndex = tableData.getIntField(5, int{}); + entry.level = tableData.getIntField(6, int{}); + entry.armor = tableData.getFloatField(7, float{}); + entry.death_behavior = tableData.getIntField(8, int{}); + entry.protection_disruption = tableData.getFloatField(9, float{}); + entry.protection_elemental = tableData.getFloatField(10, float{}); + entry.protection_physical = tableData.getFloatField(11, float{}); + entry.isnpc = tableData.getIntField(12, bool{}); + entry.attack_priority = tableData.getIntField(13, int{}); + entry.isSmashable = tableData.getIntField(14, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDDestructibleComponentTable::~CDDestructibleComponentTable(void) { } +CDDestructibleComponentTable::~CDDestructibleComponentTable() { +} -//! Returns the table's name std::string CDDestructibleComponentTable::GetName(void) const { - return "DestructibleComponent"; + return "DestructibleComponent"; } -//! Queries the table with a custom "where" clause std::vector CDDestructibleComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDDestructibleComponentTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDDestructibleComponentTable.h b/dDatabase/Tables/CDDestructibleComponentTable.h index 9768b6d..f1e33da 100644 --- a/dDatabase/Tables/CDDestructibleComponentTable.h +++ b/dDatabase/Tables/CDDestructibleComponentTable.h @@ -1,60 +1,35 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDDestructibleComponentTable.hpp - \brief Contains data for the DestructibleComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.954948 +//DO NOT EDIT THIS FILE MANUALLY! -//! ItemComponent Struct struct CDDestructibleComponent { - unsigned int id; //!< The component ID from the ComponentsRegistry Table - int faction; //!< The Faction ID of the object - std::string factionList; //!< A list of the faction IDs - int life; //!< The amount of life of the object - unsigned int imagination; //!< The amount of imagination of the object - int LootMatrixIndex; //!< The Loot Matrix Index - int CurrencyIndex; //!< The Currency Index - unsigned int level; //!< ??? - float armor; //!< The amount of armor of the object - unsigned int death_behavior; //!< The behavior ID of the death behavior - bool isnpc; //!< Whether or not the object is an NPC - unsigned int attack_priority; //!< ??? - bool isSmashable; //!< Whether or not the object is smashable - int difficultyLevel; //!< ??? + int id; + int faction; + int life; + int imagination; + int LootMatrixIndex; + int CurrencyIndex; + int level; + float armor; + int death_behavior; + float protection_disruption; + float protection_elemental; + float protection_physical; + bool isnpc; + int attack_priority; + bool isSmashable; }; -//! ItemComponent table class CDDestructibleComponentTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDDestructibleComponentTable(void); - - //! Destructor - ~CDDestructibleComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDDestructibleComponentTable(); + ~CDDestructibleComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDDevModelBehaviorsTable.cpp b/dDatabase/Tables/CDDevModelBehaviorsTable.cpp new file mode 100644 index 0000000..3ec0f24 --- /dev/null +++ b/dDatabase/Tables/CDDevModelBehaviorsTable.cpp @@ -0,0 +1,45 @@ +#include "CDDevModelBehaviorsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.961930 +//DO NOT EDIT THIS FILE MANUALLY! + +CDDevModelBehaviorsTable::CDDevModelBehaviorsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM DevModelBehaviors"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM DevModelBehaviors"); + while (!tableData.eof()) { + CDDevModelBehaviors entry; + entry.ModelID = tableData.getIntField(0, int{}); + entry.BehaviorID = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDDevModelBehaviorsTable::~CDDevModelBehaviorsTable() { +} + +std::string CDDevModelBehaviorsTable::GetName(void) const { + return "DevModelBehaviors"; +} + +std::vector CDDevModelBehaviorsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDDevModelBehaviorsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDDevModelBehaviorsTable.h b/dDatabase/Tables/CDDevModelBehaviorsTable.h new file mode 100644 index 0000000..28cdd59 --- /dev/null +++ b/dDatabase/Tables/CDDevModelBehaviorsTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.958937 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDDevModelBehaviors { + int ModelID; + int BehaviorID; +}; + +class CDDevModelBehaviorsTable : public CDTable { +private: + std::vector m_entries; +public: + CDDevModelBehaviorsTable(); + ~CDDevModelBehaviorsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDEmoteTable.cpp b/dDatabase/Tables/CDEmoteTable.cpp deleted file mode 100644 index 63e985e..0000000 --- a/dDatabase/Tables/CDEmoteTable.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "CDEmoteTable.h" - -//! Constructor -CDEmoteTableTable::CDEmoteTableTable(void) { - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes"); - while (!tableData.eof()) { - CDEmoteTable* entry = new CDEmoteTable(); - entry->ID = tableData.getIntField(0, -1); - entry->animationName = tableData.getStringField(1, ""); - entry->iconFilename = tableData.getStringField(2, ""); - entry->channel = tableData.getIntField(3, -1); - entry->locked = tableData.getIntField(5, -1) != 0; - entry->localize = tableData.getIntField(6, -1) != 0; - entry->locState = tableData.getIntField(7, -1); - entry->gateVersion = tableData.getIntField(8, -1); - - entries.insert(std::make_pair(entry->ID, entry)); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDEmoteTableTable::~CDEmoteTableTable(void) { - for (auto e : entries) { - if (e.second) delete e.second; - } - - entries.clear(); -} - -//! Returns the table's name -std::string CDEmoteTableTable::GetName(void) const { - return "Emotes"; -} - -CDEmoteTable * CDEmoteTableTable::GetEmote(int id) { - for (auto e : entries) { - if (e.first == id) return e.second; - } - - return nullptr; -} diff --git a/dDatabase/Tables/CDEmoteTable.h b/dDatabase/Tables/CDEmoteTable.h deleted file mode 100644 index 9fd1999..0000000 --- a/dDatabase/Tables/CDEmoteTable.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" -#include - -/*! - \file CDEmoteTable.hpp - \brief Contains data for the CDEmoteTable table - */ - -//! CDEmoteEntry Struct -struct CDEmoteTable { - CDEmoteTable() { - ID = -1; - animationName = ""; - iconFilename = ""; - locState = -1; - channel = -1; - locked = false; - localize = false; - gateVersion = -1; - } - - int ID; - std::string animationName; - std::string iconFilename; - int locState; - int channel; - bool locked; - bool localize; - int gateVersion; -}; - -//! CDEmoteTable table -class CDEmoteTableTable : public CDTable { -private: - std::map entries; - -public: - - //! Constructor - CDEmoteTableTable(void); - - //! Destructor - ~CDEmoteTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Returns an emote by ID - CDEmoteTable* GetEmote(int id); -}; diff --git a/dDatabase/Tables/CDEmotesTable.cpp b/dDatabase/Tables/CDEmotesTable.cpp new file mode 100644 index 0000000..b433caa --- /dev/null +++ b/dDatabase/Tables/CDEmotesTable.cpp @@ -0,0 +1,51 @@ +#include "CDEmotesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.969908 +//DO NOT EDIT THIS FILE MANUALLY! + +CDEmotesTable::CDEmotesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Emotes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Emotes"); + while (!tableData.eof()) { + CDEmotes entry; + entry.id = tableData.getIntField(0, int{}); + entry.outputText = tableData.getStringField(1, std::string{}.c_str()); + entry.targetText = tableData.getStringField(2, std::string{}.c_str()); + entry.animationName = tableData.getStringField(3, std::string{}.c_str()); + entry.iconFilename = tableData.getStringField(4, std::string{}.c_str()); + entry.channel = tableData.getStringField(5, std::string{}.c_str()); + entry.command = tableData.getStringField(6, std::string{}.c_str()); + entry.locked = tableData.getIntField(7, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDEmotesTable::~CDEmotesTable() { +} + +std::string CDEmotesTable::GetName(void) const { + return "Emotes"; +} + +std::vector CDEmotesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDEmotesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDEmotesTable.h b/dDatabase/Tables/CDEmotesTable.h new file mode 100644 index 0000000..3934b99 --- /dev/null +++ b/dDatabase/Tables/CDEmotesTable.h @@ -0,0 +1,28 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.968910 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDEmotes { + int id; + std::string outputText; + std::string targetText; + std::string animationName; + std::string iconFilename; + std::string channel; + std::string command; + bool locked; +}; + +class CDEmotesTable : public CDTable { +private: + std::vector m_entries; +public: + CDEmotesTable(); + ~CDEmotesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDExhibitComponentTable.cpp b/dDatabase/Tables/CDExhibitComponentTable.cpp new file mode 100644 index 0000000..f334df9 --- /dev/null +++ b/dDatabase/Tables/CDExhibitComponentTable.cpp @@ -0,0 +1,52 @@ +#include "CDExhibitComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.974894 +//DO NOT EDIT THIS FILE MANUALLY! + +CDExhibitComponentTable::CDExhibitComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ExhibitComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ExhibitComponent"); + while (!tableData.eof()) { + CDExhibitComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.length = tableData.getFloatField(1, float{}); + entry.width = tableData.getFloatField(2, float{}); + entry.height = tableData.getFloatField(3, float{}); + entry.offsetX = tableData.getFloatField(4, float{}); + entry.offsetY = tableData.getFloatField(5, float{}); + entry.offsetZ = tableData.getFloatField(6, float{}); + entry.fReputationSizeMultiplier = tableData.getFloatField(7, float{}); + entry.fImaginationCost = tableData.getFloatField(8, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDExhibitComponentTable::~CDExhibitComponentTable() { +} + +std::string CDExhibitComponentTable::GetName(void) const { + return "ExhibitComponent"; +} + +std::vector CDExhibitComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDExhibitComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDExhibitComponentTable.h b/dDatabase/Tables/CDExhibitComponentTable.h new file mode 100644 index 0000000..37e2d4c --- /dev/null +++ b/dDatabase/Tables/CDExhibitComponentTable.h @@ -0,0 +1,29 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.972899 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDExhibitComponent { + int id; + float length; + float width; + float height; + float offsetX; + float offsetY; + float offsetZ; + float fReputationSizeMultiplier; + float fImaginationCost; +}; + +class CDExhibitComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDExhibitComponentTable(); + ~CDExhibitComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDFactionsTable.cpp b/dDatabase/Tables/CDFactionsTable.cpp new file mode 100644 index 0000000..7f10040 --- /dev/null +++ b/dDatabase/Tables/CDFactionsTable.cpp @@ -0,0 +1,47 @@ +#include "CDFactionsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.979881 +//DO NOT EDIT THIS FILE MANUALLY! + +CDFactionsTable::CDFactionsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Factions"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Factions"); + while (!tableData.eof()) { + CDFactions entry; + entry.faction = tableData.getIntField(0, int{}); + entry.factionList = tableData.getStringField(1, std::string{}.c_str()); + entry.factionListFriendly = tableData.getIntField(2, bool{}); + entry.description = tableData.getStringField(3, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDFactionsTable::~CDFactionsTable() { +} + +std::string CDFactionsTable::GetName(void) const { + return "Factions"; +} + +std::vector CDFactionsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDFactionsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDFactionsTable.h b/dDatabase/Tables/CDFactionsTable.h new file mode 100644 index 0000000..8eda599 --- /dev/null +++ b/dDatabase/Tables/CDFactionsTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.977888 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDFactions { + int faction; + std::string factionList; + bool factionListFriendly; + std::string description; +}; + +class CDFactionsTable : public CDTable { +private: + std::vector m_entries; +public: + CDFactionsTable(); + ~CDFactionsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDFeatureGatingTable.cpp b/dDatabase/Tables/CDFeatureGatingTable.cpp deleted file mode 100644 index 6a370e8..0000000 --- a/dDatabase/Tables/CDFeatureGatingTable.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "CDFeatureGatingTable.h" - -//! Constructor -CDFeatureGatingTable::CDFeatureGatingTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM FeatureGating"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM FeatureGating"); - while (!tableData.eof()) { - CDFeatureGating entry; - entry.featureName = tableData.getStringField(0, ""); - entry.major = tableData.getIntField(1, -1); - entry.current = tableData.getIntField(2, -1); - entry.minor = tableData.getIntField(3, -1); - entry.description = tableData.getStringField(4, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDFeatureGatingTable::~CDFeatureGatingTable(void) { } - -//! Returns the table's name -std::string CDFeatureGatingTable::GetName(void) const { - return "FeatureGating"; -} - -//! Queries the table with a custom "where" clause -std::vector CDFeatureGatingTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -bool CDFeatureGatingTable::FeatureUnlocked(const std::string& feature) const -{ - for (const auto& entry : entries) - { - if (entry.featureName == feature) - { - return true; - } - } - - return false; -} - -//! Gets all the entries in the table -std::vector CDFeatureGatingTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDFeatureGatingTable.h b/dDatabase/Tables/CDFeatureGatingTable.h deleted file mode 100644 index 11c25e6..0000000 --- a/dDatabase/Tables/CDFeatureGatingTable.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDFeatureGatingTable.hpp - */ - -//! ItemComponent Struct -struct CDFeatureGating { - std::string featureName; - int32_t major; - int32_t current; - int32_t minor; - std::string description; -}; - -//! ItemComponent table -class CDFeatureGatingTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDFeatureGatingTable(void); - - //! Destructor - ~CDFeatureGatingTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - bool FeatureUnlocked(const std::string& feature) const; - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; diff --git a/dDatabase/Tables/CDFlairTableTable.cpp b/dDatabase/Tables/CDFlairTableTable.cpp new file mode 100644 index 0000000..ab5d653 --- /dev/null +++ b/dDatabase/Tables/CDFlairTableTable.cpp @@ -0,0 +1,45 @@ +#include "CDFlairTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.985865 +//DO NOT EDIT THIS FILE MANUALLY! + +CDFlairTableTable::CDFlairTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM FlairTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM FlairTable"); + while (!tableData.eof()) { + CDFlairTable entry; + entry.id = tableData.getIntField(0, int{}); + entry.asset = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDFlairTableTable::~CDFlairTableTable() { +} + +std::string CDFlairTableTable::GetName(void) const { + return "FlairTable"; +} + +std::vector CDFlairTableTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDFlairTableTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDFlairTableTable.h b/dDatabase/Tables/CDFlairTableTable.h new file mode 100644 index 0000000..c6122be --- /dev/null +++ b/dDatabase/Tables/CDFlairTableTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.982873 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDFlairTable { + int id; + std::string asset; +}; + +class CDFlairTableTable : public CDTable { +private: + std::vector m_entries; +public: + CDFlairTableTable(); + ~CDFlairTableTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDFootstepsTable.cpp b/dDatabase/Tables/CDFootstepsTable.cpp new file mode 100644 index 0000000..5bd8ccd --- /dev/null +++ b/dDatabase/Tables/CDFootstepsTable.cpp @@ -0,0 +1,50 @@ +#include "CDFootstepsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.988857 +//DO NOT EDIT THIS FILE MANUALLY! + +CDFootstepsTable::CDFootstepsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Footsteps"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Footsteps"); + while (!tableData.eof()) { + CDFootsteps entry; + entry.objectType = tableData.getStringField(0, std::string{}.c_str()); + entry.stone = tableData.getStringField(1, std::string{}.c_str()); + entry.grass = tableData.getStringField(2, std::string{}.c_str()); + entry.wood = tableData.getStringField(3, std::string{}.c_str()); + entry.plastic = tableData.getStringField(4, std::string{}.c_str()); + entry.gravel = tableData.getStringField(5, std::string{}.c_str()); + entry.mud = tableData.getStringField(6, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDFootstepsTable::~CDFootstepsTable() { +} + +std::string CDFootstepsTable::GetName(void) const { + return "Footsteps"; +} + +std::vector CDFootstepsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDFootstepsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDFootstepsTable.h b/dDatabase/Tables/CDFootstepsTable.h new file mode 100644 index 0000000..020e36b --- /dev/null +++ b/dDatabase/Tables/CDFootstepsTable.h @@ -0,0 +1,27 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.987860 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDFootsteps { + std::string objectType; + std::string stone; + std::string grass; + std::string wood; + std::string plastic; + std::string gravel; + std::string mud; +}; + +class CDFootstepsTable : public CDTable { +private: + std::vector m_entries; +public: + CDFootstepsTable(); + ~CDFootstepsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDIconsTable.cpp b/dDatabase/Tables/CDIconsTable.cpp new file mode 100644 index 0000000..6b6131b --- /dev/null +++ b/dDatabase/Tables/CDIconsTable.cpp @@ -0,0 +1,46 @@ +#include "CDIconsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.990911 +//DO NOT EDIT THIS FILE MANUALLY! + +CDIconsTable::CDIconsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Icons"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Icons"); + while (!tableData.eof()) { + CDIcons entry; + entry.IconID = tableData.getIntField(0, int{}); + entry.IconPath = tableData.getStringField(1, std::string{}.c_str()); + entry.IconName = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDIconsTable::~CDIconsTable() { +} + +std::string CDIconsTable::GetName(void) const { + return "Icons"; +} + +std::vector CDIconsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDIconsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDIconsTable.h b/dDatabase/Tables/CDIconsTable.h new file mode 100644 index 0000000..5025268 --- /dev/null +++ b/dDatabase/Tables/CDIconsTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.989854 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDIcons { + int IconID; + std::string IconPath; + std::string IconName; +}; + +class CDIconsTable : public CDTable { +private: + std::vector m_entries; +public: + CDIconsTable(); + ~CDIconsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDInventoryComponentTable.cpp b/dDatabase/Tables/CDInventoryComponentTable.cpp index b0849a4..d2b280f 100644 --- a/dDatabase/Tables/CDInventoryComponentTable.cpp +++ b/dDatabase/Tables/CDInventoryComponentTable.cpp @@ -1,57 +1,47 @@ #include "CDInventoryComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.994844 +//DO NOT EDIT THIS FILE MANUALLY! + +CDInventoryComponentTable::CDInventoryComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM InventoryComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDInventoryComponentTable::CDInventoryComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM InventoryComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM InventoryComponent"); - while (!tableData.eof()) { - CDInventoryComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.itemid = tableData.getIntField(1, -1); - entry.count = tableData.getIntField(2, -1); - entry.equip = tableData.getIntField(3, -1) == 1 ? true : false; - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM InventoryComponent"); + while (!tableData.eof()) { + CDInventoryComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.itemid = tableData.getIntField(1, int{}); + entry.count = tableData.getIntField(2, int{}); + entry.equip = tableData.getIntField(3, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDInventoryComponentTable::~CDInventoryComponentTable(void) { } +CDInventoryComponentTable::~CDInventoryComponentTable() { +} -//! Returns the table's name std::string CDInventoryComponentTable::GetName(void) const { - return "InventoryComponent"; + return "InventoryComponent"; } -//! Queries the table with a custom "where" clause std::vector CDInventoryComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDInventoryComponentTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDInventoryComponentTable.h b/dDatabase/Tables/CDInventoryComponentTable.h index 3bce41f..6033da8 100644 --- a/dDatabase/Tables/CDInventoryComponentTable.h +++ b/dDatabase/Tables/CDInventoryComponentTable.h @@ -1,50 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDInventoryComponentTable.hpp - \brief Contains data for the InventoryComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.993843 +//DO NOT EDIT THIS FILE MANUALLY! -//! ItemComponent Struct struct CDInventoryComponent { - unsigned int id; //!< The component ID for this object - unsigned int itemid; //!< The LOT of the object - unsigned int count; //!< The count of the items the object has - bool equip; //!< Whether or not to equip the item + int id; + int itemid; + int count; + bool equip; }; -//! ItemComponent table class CDInventoryComponentTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDInventoryComponentTable(void); - - //! Destructor - ~CDInventoryComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - + CDInventoryComponentTable(); + ~CDInventoryComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDItemComponentTable.cpp b/dDatabase/Tables/CDItemComponentTable.cpp index 149b2ce..9f5244a 100644 --- a/dDatabase/Tables/CDItemComponentTable.cpp +++ b/dDatabase/Tables/CDItemComponentTable.cpp @@ -1,179 +1,74 @@ #include "CDItemComponentTable.h" -#include "GeneralUtils.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.999829 +//DO NOT EDIT THIS FILE MANUALLY! -CDItemComponent CDItemComponentTable::Default = {}; +CDItemComponentTable::CDItemComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDItemComponentTable::CDItemComponentTable(void) { - Default = CDItemComponent(); - -#ifdef CDCLIENT_CACHE_ALL - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemComponent"); - while (!tableData.eof()) { - CDItemComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.equipLocation = tableData.getStringField(1, ""); - entry.baseValue = tableData.getIntField(2, -1); - entry.isKitPiece = tableData.getIntField(3, -1) == 1 ? true : false; - entry.rarity = tableData.getIntField(4, 0); - entry.itemType = tableData.getIntField(5, -1); - entry.itemInfo = tableData.getInt64Field(6, -1); - entry.inLootTable = tableData.getIntField(7, -1) == 1 ? true : false; - entry.inVendor = tableData.getIntField(8, -1) == 1 ? true : false; - entry.isUnique = tableData.getIntField(9, -1) == 1 ? true : false; - entry.isBOP = tableData.getIntField(10, -1) == 1 ? true : false; - entry.isBOE = tableData.getIntField(11, -1) == 1 ? true : false; - entry.reqFlagID = tableData.getIntField(12, -1); - entry.reqSpecialtyID = tableData.getIntField(13, -1); - entry.reqSpecRank = tableData.getIntField(14, -1); - entry.reqAchievementID = tableData.getIntField(15, -1); - entry.stackSize = tableData.getIntField(16, -1); - entry.color1 = tableData.getIntField(17, -1); - entry.decal = tableData.getIntField(18, -1); - entry.offsetGroupID = tableData.getIntField(19, -1); - entry.buildTypes = tableData.getIntField(20, -1); - entry.reqPrecondition = tableData.getStringField(21, ""); - entry.animationFlag = tableData.getIntField(22, -1); - entry.equipEffects = tableData.getIntField(23, -1); - entry.readyForQA = tableData.getIntField(24, -1) == 1 ? true : false; - entry.itemRating = tableData.getIntField(25, -1); - entry.isTwoHanded = tableData.getIntField(26, -1) == 1 ? true : false; - entry.minNumRequired = tableData.getIntField(27, -1); - entry.delResIndex = tableData.getIntField(28, -1); - entry.currencyLOT = tableData.getIntField(29, -1); - entry.altCurrencyCost = tableData.getIntField(30, -1); - entry.subItems = tableData.getStringField(31, ""); - entry.audioEventUse = tableData.getStringField(32, ""); - entry.noEquipAnimation = tableData.getIntField(33, -1) == 1 ? true : false; - entry.commendationLOT = tableData.getIntField(34, -1); - entry.commendationCost = tableData.getIntField(35, -1); - entry.audioEquipMetaEventSet = tableData.getStringField(36, ""); - entry.currencyCosts = tableData.getStringField(37, ""); - entry.ingredientInfo = tableData.getStringField(38, ""); - entry.locStatus = tableData.getIntField(39, -1); - entry.forgeType = tableData.getIntField(40, -1); - entry.SellMultiplier = tableData.getFloatField(41, -1.0f); - - this->entries.insert(std::make_pair(entry.id, entry)); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemComponent"); + while (!tableData.eof()) { + CDItemComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.equipLocation = tableData.getStringField(1, std::string{}.c_str()); + entry.baseValue = tableData.getIntField(2, int{}); + entry.isKitPiece = tableData.getIntField(3, bool{}); + entry.rarity = tableData.getIntField(4, int{}); + entry.itemType = tableData.getIntField(5, int{}); + entry.itemInfo = tableData.getIntField(6, int{}); + entry.inLootTable = tableData.getIntField(7, bool{}); + entry.inVendor = tableData.getIntField(8, bool{}); + entry.isUnique = tableData.getIntField(9, bool{}); + entry.isBOP = tableData.getIntField(10, bool{}); + entry.isBOE = tableData.getIntField(11, bool{}); + entry.reqFactionID = tableData.getIntField(12, int{}); + entry.reqSpecialtyID = tableData.getIntField(13, int{}); + entry.reqSpecRank = tableData.getIntField(14, int{}); + entry.reqAchievementID = tableData.getIntField(15, int{}); + entry.stackSize = tableData.getIntField(16, int{}); + entry.color1 = tableData.getIntField(17, int{}); + entry.decal = tableData.getIntField(18, int{}); + entry.offsetGroupID = tableData.getIntField(19, int{}); + entry.buildTypes = tableData.getIntField(20, int{}); + entry.reqPrecondition = tableData.getStringField(21, std::string{}.c_str()); + entry.weaponType = tableData.getIntField(22, int{}); + entry.equipEffects = tableData.getIntField(23, int{}); + entry.readyForQA = tableData.getIntField(24, bool{}); + entry.itemRating = tableData.getIntField(25, int{}); + entry.isTwoHanded = tableData.getIntField(26, bool{}); + entry.minNumRequired = tableData.getIntField(27, int{}); + entry.delResIndex = tableData.getIntField(28, int{}); + entry.currencyLOT = tableData.getIntField(29, int{}); + entry.altCurrencyCost = tableData.getIntField(30, int{}); + this->m_entries.push_back(entry); tableData.nextRow(); - } + } tableData.finalize(); -#endif } -//! Destructor -CDItemComponentTable::~CDItemComponentTable(void) { } +CDItemComponentTable::~CDItemComponentTable() { +} -//! Returns the table's name std::string CDItemComponentTable::GetName(void) const { - return "ItemComponent"; + return "ItemComponent"; } -const CDItemComponent & CDItemComponentTable::GetItemComponentByID(unsigned int skillID) { - const auto& it = this->entries.find(skillID); - if (it != this->entries.end()) { - return it->second; - } +std::vector CDItemComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); -#ifndef CDCLIENT_CACHE_ALL - std::stringstream query; - - query << "SELECT * FROM ItemComponent WHERE id = " << std::to_string(skillID); - - auto tableData = CDClientDatabase::ExecuteQuery(query.str()); - if (tableData.eof()) { - entries.insert(std::make_pair(skillID, Default)); - return Default; - } - - while (!tableData.eof()) { - CDItemComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.equipLocation = tableData.getStringField(1, ""); - entry.baseValue = tableData.getIntField(2, -1); - entry.isKitPiece = tableData.getIntField(3, -1) == 1 ? true : false; - entry.rarity = tableData.getIntField(4, 0); - entry.itemType = tableData.getIntField(5, -1); - entry.itemInfo = tableData.getInt64Field(6, -1); - entry.inLootTable = tableData.getIntField(7, -1) == 1 ? true : false; - entry.inVendor = tableData.getIntField(8, -1) == 1 ? true : false; - entry.isUnique = tableData.getIntField(9, -1) == 1 ? true : false; - entry.isBOP = tableData.getIntField(10, -1) == 1 ? true : false; - entry.isBOE = tableData.getIntField(11, -1) == 1 ? true : false; - entry.reqFlagID = tableData.getIntField(12, -1); - entry.reqSpecialtyID = tableData.getIntField(13, -1); - entry.reqSpecRank = tableData.getIntField(14, -1); - entry.reqAchievementID = tableData.getIntField(15, -1); - entry.stackSize = tableData.getIntField(16, -1); - entry.color1 = tableData.getIntField(17, -1); - entry.decal = tableData.getIntField(18, -1); - entry.offsetGroupID = tableData.getIntField(19, -1); - entry.buildTypes = tableData.getIntField(20, -1); - entry.reqPrecondition = tableData.getStringField(21, ""); - entry.animationFlag = tableData.getIntField(22, -1); - entry.equipEffects = tableData.getIntField(23, -1); - entry.readyForQA = tableData.getIntField(24, -1) == 1 ? true : false; - entry.itemRating = tableData.getIntField(25, -1); - entry.isTwoHanded = tableData.getIntField(26, -1) == 1 ? true : false; - entry.minNumRequired = tableData.getIntField(27, -1); - entry.delResIndex = tableData.getIntField(28, -1); - entry.currencyLOT = tableData.getIntField(29, -1); - entry.altCurrencyCost = tableData.getIntField(30, -1); - entry.subItems = tableData.getStringField(31, ""); - UNUSED(entry.audioEventUse = tableData.getStringField(32, "")); - entry.noEquipAnimation = tableData.getIntField(33, -1) == 1 ? true : false; - entry.commendationLOT = tableData.getIntField(34, -1); - entry.commendationCost = tableData.getIntField(35, -1); - UNUSED(entry.audioEquipMetaEventSet = tableData.getStringField(36, "")); - entry.currencyCosts = tableData.getStringField(37, ""); - UNUSED(entry.ingredientInfo = tableData.getStringField(38, "")); - entry.locStatus = tableData.getIntField(39, -1); - entry.forgeType = tableData.getIntField(40, -1); - entry.SellMultiplier = tableData.getFloatField(41, -1.0f); - - this->entries.insert(std::make_pair(entry.id, entry)); - tableData.nextRow(); - } - - const auto& it2 = this->entries.find(skillID); - if (it2 != this->entries.end()) { - return it2->second; - } -#endif - - return Default; + return data; } -std::map CDItemComponentTable::ParseCraftingCurrencies(const CDItemComponent& itemComponent) { - std::map currencies = {}; - - if (!itemComponent.currencyCosts.empty()) { - auto currencySplit = GeneralUtils::SplitString(itemComponent.currencyCosts, ','); - for (const auto& currencyAmount : currencySplit) { - auto amountSplit = GeneralUtils::SplitString(currencyAmount, ':'); - - // Checking for 2 here, not sure what to do when there's more stuff than expected - if (amountSplit.size() == 2) { - currencies.insert({ - std::stol(amountSplit[0]), - std::stoi(amountSplit[1]) - }); - } - } - } - - return currencies; +std::vector CDItemComponentTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDItemComponentTable.h b/dDatabase/Tables/CDItemComponentTable.h index 83b66f9..4b81805 100644 --- a/dDatabase/Tables/CDItemComponentTable.h +++ b/dDatabase/Tables/CDItemComponentTable.h @@ -1,83 +1,51 @@ #pragma once - -// Custom Classes #include "CDTable.h" -#include "dCommonVars.h" -/*! - \file CDItemComponentTable.hpp - \brief Contains data for the ItemComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.998113 +//DO NOT EDIT THIS FILE MANUALLY! -//! ItemComponent Struct struct CDItemComponent { - unsigned int id; //!< The Component ID - std::string equipLocation; //!< The equip location - unsigned int baseValue; //!< The monetary base value of the item - bool isKitPiece; //!< Whether or not the item belongs to a kit - unsigned int rarity; //!< The rarity of the item - unsigned int itemType; //!< The item type - int64_t itemInfo; //!< The item info - bool inLootTable; //!< Whether or not the item is in a loot table - bool inVendor; //!< Whether or not the item is in a vendor inventory - bool isUnique; //!< ??? - bool isBOP; //!< ??? - bool isBOE; //!< ??? - unsigned int reqFlagID; //!< User must have completed this flag to get the item - unsigned int reqSpecialtyID; //!< ??? - unsigned int reqSpecRank; //!< ??? - unsigned int reqAchievementID; //!< The required achievement must be completed - unsigned int stackSize; //!< The stack size of the item - unsigned int color1; //!< Something to do with item color... - unsigned int decal; //!< The decal of the item - unsigned int offsetGroupID; //!< Something to do with group IDs - unsigned int buildTypes; //!< Something to do with building - std::string reqPrecondition; //!< The required precondition - unsigned int animationFlag; //!< The Animation Flag - unsigned int equipEffects; //!< The effect played when the item is equipped - bool readyForQA; //!< ??? - unsigned int itemRating; //!< ??? - bool isTwoHanded; //!< Whether or not the item is double handed - unsigned int minNumRequired; //!< Maybe the minimum number required for a mission, or to own this object? - unsigned int delResIndex; //!< ??? - unsigned int currencyLOT; //!< ??? - unsigned int altCurrencyCost; //!< ??? - std::string subItems; //!< A comma seperate string of sub items (maybe for multi-itemed things like faction test gear set) - UNUSED(std::string audioEventUse); //!< ??? - bool noEquipAnimation; //!< Whether or not there is an equip animation - unsigned int commendationLOT; //!< The commendation LOT - unsigned int commendationCost; //!< The commendation cost - UNUSED(std::string audioEquipMetaEventSet); //!< ??? - std::string currencyCosts; //!< Used for crafting - UNUSED(std::string ingredientInfo); //!< Unused - unsigned int locStatus; //!< ??? - unsigned int forgeType; //!< Forge Type - float SellMultiplier; //!< Something to do with early vendors perhaps (but replaced) + int id; + std::string equipLocation; + int baseValue; + bool isKitPiece; + int rarity; + int itemType; + int itemInfo; + bool inLootTable; + bool inVendor; + bool isUnique; + bool isBOP; + bool isBOE; + int reqFactionID; + int reqSpecialtyID; + int reqSpecRank; + int reqAchievementID; + int stackSize; + int color1; + int decal; + int offsetGroupID; + int buildTypes; + std::string reqPrecondition; + int weaponType; + int equipEffects; + bool readyForQA; + int itemRating; + bool isTwoHanded; + int minNumRequired; + int delResIndex; + int currencyLOT; + int altCurrencyCost; }; -//! ItemComponent table class CDItemComponentTable : public CDTable { private: - std::map entries; - + std::vector m_entries; public: - - //! Constructor - CDItemComponentTable(void); - - //! Destructor - ~CDItemComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; + CDItemComponentTable(); + ~CDItemComponentTable(); + std::string GetName(void) const override; - static std::map ParseCraftingCurrencies(const CDItemComponent& itemComponent); - - //! Gets an entry by ID - const CDItemComponent& GetItemComponentByID(unsigned int skillID); - - static CDItemComponent Default; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; diff --git a/dDatabase/Tables/CDItemEggDataTable.cpp b/dDatabase/Tables/CDItemEggDataTable.cpp new file mode 100644 index 0000000..d9305ac --- /dev/null +++ b/dDatabase/Tables/CDItemEggDataTable.cpp @@ -0,0 +1,45 @@ +#include "CDItemEggDataTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.004814 +//DO NOT EDIT THIS FILE MANUALLY! + +CDItemEggDataTable::CDItemEggDataTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemEggData"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemEggData"); + while (!tableData.eof()) { + CDItemEggData entry; + entry.id = tableData.getIntField(0, int{}); + entry.chassie_type_id = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDItemEggDataTable::~CDItemEggDataTable() { +} + +std::string CDItemEggDataTable::GetName(void) const { + return "ItemEggData"; +} + +std::vector CDItemEggDataTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDItemEggDataTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDItemEggDataTable.h b/dDatabase/Tables/CDItemEggDataTable.h new file mode 100644 index 0000000..c23f05b --- /dev/null +++ b/dDatabase/Tables/CDItemEggDataTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.003604 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDItemEggData { + int id; + int chassie_type_id; +}; + +class CDItemEggDataTable : public CDTable { +private: + std::vector m_entries; +public: + CDItemEggDataTable(); + ~CDItemEggDataTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDItemFoodDataTable.cpp b/dDatabase/Tables/CDItemFoodDataTable.cpp new file mode 100644 index 0000000..ce63d68 --- /dev/null +++ b/dDatabase/Tables/CDItemFoodDataTable.cpp @@ -0,0 +1,52 @@ +#include "CDItemFoodDataTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.006810 +//DO NOT EDIT THIS FILE MANUALLY! + +CDItemFoodDataTable::CDItemFoodDataTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemFoodData"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemFoodData"); + while (!tableData.eof()) { + CDItemFoodData entry; + entry.id = tableData.getIntField(0, int{}); + entry.element_1 = tableData.getIntField(1, int{}); + entry.element_1_amount = tableData.getIntField(2, int{}); + entry.element_2 = tableData.getIntField(3, int{}); + entry.element_2_amount = tableData.getIntField(4, int{}); + entry.element_3 = tableData.getIntField(5, int{}); + entry.element_3_amount = tableData.getIntField(6, int{}); + entry.element_4 = tableData.getIntField(7, int{}); + entry.element_4_amount = tableData.getIntField(8, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDItemFoodDataTable::~CDItemFoodDataTable() { +} + +std::string CDItemFoodDataTable::GetName(void) const { + return "ItemFoodData"; +} + +std::vector CDItemFoodDataTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDItemFoodDataTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDItemFoodDataTable.h b/dDatabase/Tables/CDItemFoodDataTable.h new file mode 100644 index 0000000..3bf348e --- /dev/null +++ b/dDatabase/Tables/CDItemFoodDataTable.h @@ -0,0 +1,29 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.006810 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDItemFoodData { + int id; + int element_1; + int element_1_amount; + int element_2; + int element_2_amount; + int element_3; + int element_3_amount; + int element_4; + int element_4_amount; +}; + +class CDItemFoodDataTable : public CDTable { +private: + std::vector m_entries; +public: + CDItemFoodDataTable(); + ~CDItemFoodDataTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDItemSetSkillsTable.cpp b/dDatabase/Tables/CDItemSetSkillsTable.cpp index b20fd1c..914b1de 100644 --- a/dDatabase/Tables/CDItemSetSkillsTable.cpp +++ b/dDatabase/Tables/CDItemSetSkillsTable.cpp @@ -1,68 +1,46 @@ #include "CDItemSetSkillsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.063657 +//DO NOT EDIT THIS FILE MANUALLY! + +CDItemSetSkillsTable::CDItemSetSkillsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemSetSkills"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDItemSetSkillsTable::CDItemSetSkillsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemSetSkills"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSetSkills"); - while (!tableData.eof()) { - CDItemSetSkills entry; - entry.SkillSetID = tableData.getIntField(0, -1); - entry.SkillID = tableData.getIntField(1, -1); - entry.SkillCastType = tableData.getIntField(2, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSetSkills"); + while (!tableData.eof()) { + CDItemSetSkills entry; + entry.SkillSetID = tableData.getIntField(0, int{}); + entry.SkillID = tableData.getIntField(1, int{}); + entry.SkillCastType = tableData.getIntField(2, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDItemSetSkillsTable::~CDItemSetSkillsTable(void) { } +CDItemSetSkillsTable::~CDItemSetSkillsTable() { +} -//! Returns the table's name std::string CDItemSetSkillsTable::GetName(void) const { - return "ItemSetSkills"; + return "ItemSetSkills"; } -//! Queries the table with a custom "where" clause std::vector CDItemSetSkillsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDItemSetSkillsTable::GetEntries(void) const { - return this->entries; -} - -std::vector CDItemSetSkillsTable::GetBySkillID(unsigned int SkillSetID) -{ - std::vector toReturn; - - for (CDItemSetSkills entry : this->entries) { - if (entry.SkillSetID == SkillSetID) toReturn.push_back(entry); - if (entry.SkillSetID > SkillSetID) return toReturn; //stop seeking in the db if it's not needed. - } - - return toReturn; + return this->m_entries; } diff --git a/dDatabase/Tables/CDItemSetSkillsTable.h b/dDatabase/Tables/CDItemSetSkillsTable.h index 78ce83a..6c3a221 100644 --- a/dDatabase/Tables/CDItemSetSkillsTable.h +++ b/dDatabase/Tables/CDItemSetSkillsTable.h @@ -1,52 +1,23 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDItemSetSkillsTable.hpp - \brief Contains data for the ItemSetSkills table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.050691 +//DO NOT EDIT THIS FILE MANUALLY! -//! ZoneTable Struct struct CDItemSetSkills { - unsigned int SkillSetID; //!< The skill set ID - unsigned int SkillID; //!< The skill ID - unsigned int SkillCastType; //!< The skill cast type + int SkillSetID; + int SkillID; + int SkillCastType; }; -//! ItemSets table class CDItemSetSkillsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDItemSetSkillsTable(void); - - //! Destructor - ~CDItemSetSkillsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; + CDItemSetSkillsTable(); + ~CDItemSetSkillsTable(); + std::string GetName(void) const override; - std::vector GetBySkillID(unsigned int SkillSetID); - +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDItemSetsTable.cpp b/dDatabase/Tables/CDItemSetsTable.cpp index ad78ee3..a6ba76d 100644 --- a/dDatabase/Tables/CDItemSetsTable.cpp +++ b/dDatabase/Tables/CDItemSetsTable.cpp @@ -1,68 +1,60 @@ #include "CDItemSetsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.013275 +//DO NOT EDIT THIS FILE MANUALLY! + +CDItemSetsTable::CDItemSetsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemSets"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDItemSetsTable::CDItemSetsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ItemSets"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - 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); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ItemSets"); + while (!tableData.eof()) { + CDItemSets entry; + entry.setID = tableData.getIntField(0, int{}); + entry.itemIDs = tableData.getStringField(1, std::string{}.c_str()); + entry.displayName = tableData.getStringField(2, std::string{}.c_str()); + entry.description = tableData.getStringField(3, std::string{}.c_str()); + entry.skillWith2 = tableData.getIntField(4, int{}); + entry.castType2 = tableData.getIntField(5, int{}); + entry.skillWith3 = tableData.getIntField(6, int{}); + entry.castType3 = tableData.getIntField(7, int{}); + entry.skillWith4 = tableData.getIntField(8, int{}); + entry.castType4 = tableData.getIntField(9, int{}); + entry.skillWith5 = tableData.getIntField(10, int{}); + entry.castType5 = tableData.getIntField(11, int{}); + entry.skillSetWith2 = tableData.getIntField(12, int{}); + entry.skillSetWith3 = tableData.getIntField(13, int{}); + entry.skillSetWith4 = tableData.getIntField(14, int{}); + entry.skillSetWith5 = tableData.getIntField(15, int{}); + entry.skillSetWith6 = tableData.getIntField(16, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDItemSetsTable::~CDItemSetsTable(void) { } +CDItemSetsTable::~CDItemSetsTable() { +} -//! Returns the table's name std::string CDItemSetsTable::GetName(void) const { - return "ItemSets"; + return "ItemSets"; } -//! Queries the table with a custom "where" clause std::vector CDItemSetsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDItemSetsTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDItemSetsTable.h b/dDatabase/Tables/CDItemSetsTable.h index 9e8b85e..2248b24 100644 --- a/dDatabase/Tables/CDItemSetsTable.h +++ b/dDatabase/Tables/CDItemSetsTable.h @@ -1,62 +1,37 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDItemSetsTable.hpp - \brief Contains data for the ItemSets table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.009803 +//DO NOT EDIT THIS FILE MANUALLY! -//! ZoneTable Struct struct CDItemSets { - unsigned int setID; //!< The item set ID - unsigned int locStatus; //!< The loc status - std::string itemIDs; //!< THe item IDs - unsigned int kitType; //!< The item kit type - unsigned int kitRank; //!< The item kit rank - unsigned int kitImage; //!< The item kit image - unsigned int skillSetWith2; //!< The skill set with 2 - unsigned int skillSetWith3; //!< The skill set with 3 - unsigned int skillSetWith4; //!< The skill set with 4 - unsigned int skillSetWith5; //!< The skill set with 5 - unsigned int skillSetWith6; //!< The skill set with 6 - bool localize; //!< Whether or localize - std::string gate_version; //!< The gate version - unsigned int kitID; //!< The kit ID - float priority; //!< The priority + int setID; + std::string itemIDs; + std::string displayName; + std::string description; + int skillWith2; + int castType2; + int skillWith3; + int castType3; + int skillWith4; + int castType4; + int skillWith5; + int castType5; + int skillSetWith2; + int skillSetWith3; + int skillSetWith4; + int skillSetWith5; + int skillSetWith6; }; -//! ItemSets table class CDItemSetsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDItemSetsTable(void); - - //! Destructor - ~CDItemSetsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; + CDItemSetsTable(); + ~CDItemSetsTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDLanguageTypeTable.cpp b/dDatabase/Tables/CDLanguageTypeTable.cpp new file mode 100644 index 0000000..93576b4 --- /dev/null +++ b/dDatabase/Tables/CDLanguageTypeTable.cpp @@ -0,0 +1,45 @@ +#include "CDLanguageTypeTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.100558 +//DO NOT EDIT THIS FILE MANUALLY! + +CDLanguageTypeTable::CDLanguageTypeTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LanguageType"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LanguageType"); + while (!tableData.eof()) { + CDLanguageType entry; + entry.LanguageID = tableData.getIntField(0, int{}); + entry.LanguageDescription = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDLanguageTypeTable::~CDLanguageTypeTable() { +} + +std::string CDLanguageTypeTable::GetName(void) const { + return "LanguageType"; +} + +std::vector CDLanguageTypeTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDLanguageTypeTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDLanguageTypeTable.h b/dDatabase/Tables/CDLanguageTypeTable.h new file mode 100644 index 0000000..235b166 --- /dev/null +++ b/dDatabase/Tables/CDLanguageTypeTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.098563 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDLanguageType { + int LanguageID; + std::string LanguageDescription; +}; + +class CDLanguageTypeTable : public CDTable { +private: + std::vector m_entries; +public: + CDLanguageTypeTable(); + ~CDLanguageTypeTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDLevelProgressionLookupTable.cpp b/dDatabase/Tables/CDLevelProgressionLookupTable.cpp deleted file mode 100644 index 0070e78..0000000 --- a/dDatabase/Tables/CDLevelProgressionLookupTable.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "CDLevelProgressionLookupTable.h" - -//! Constructor -CDLevelProgressionLookupTable::CDLevelProgressionLookupTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LevelProgressionLookup"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LevelProgressionLookup"); - while (!tableData.eof()) { - CDLevelProgressionLookup entry; - entry.id = tableData.getIntField(0, -1); - entry.requiredUScore = tableData.getIntField(1, -1); - entry.BehaviorEffect = tableData.getStringField(2, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDLevelProgressionLookupTable::~CDLevelProgressionLookupTable(void) { } - -//! Returns the table's name -std::string CDLevelProgressionLookupTable::GetName(void) const { - return "LevelProgressionLookup"; -} - -//! Queries the table with a custom "where" clause -std::vector CDLevelProgressionLookupTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -//! Gets all the entries in the table -std::vector CDLevelProgressionLookupTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDLevelProgressionLookupTable.h b/dDatabase/Tables/CDLevelProgressionLookupTable.h deleted file mode 100644 index 4174cdf..0000000 --- a/dDatabase/Tables/CDLevelProgressionLookupTable.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDLevelProgressionLookupTable.hpp - \brief Contains data for the LevelProgressionLookup table - */ - -//! LevelProgressionLookup Entry Struct -struct CDLevelProgressionLookup { - unsigned int id; //!< The Level ID - unsigned int requiredUScore; //!< The required LEGO Score - std::string BehaviorEffect; //!< The behavior effect attached to this -}; - -//! LevelProgressionLookup table -class CDLevelProgressionLookupTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDLevelProgressionLookupTable(void); - - //! Destructor - ~CDLevelProgressionLookupTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; diff --git a/dDatabase/Tables/CDLootMatrixIndexTable.cpp b/dDatabase/Tables/CDLootMatrixIndexTable.cpp new file mode 100644 index 0000000..a56046e --- /dev/null +++ b/dDatabase/Tables/CDLootMatrixIndexTable.cpp @@ -0,0 +1,46 @@ +#include "CDLootMatrixIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.116515 +//DO NOT EDIT THIS FILE MANUALLY! + +CDLootMatrixIndexTable::CDLootMatrixIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootMatrixIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootMatrixIndex"); + while (!tableData.eof()) { + CDLootMatrixIndex entry; + entry.LootMatrixIndex = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.inNpcEditor = tableData.getIntField(2, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDLootMatrixIndexTable::~CDLootMatrixIndexTable() { +} + +std::string CDLootMatrixIndexTable::GetName(void) const { + return "LootMatrixIndex"; +} + +std::vector CDLootMatrixIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDLootMatrixIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDLootMatrixIndexTable.h b/dDatabase/Tables/CDLootMatrixIndexTable.h new file mode 100644 index 0000000..305aabc --- /dev/null +++ b/dDatabase/Tables/CDLootMatrixIndexTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.115518 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDLootMatrixIndex { + int LootMatrixIndex; + std::string description; + bool inNpcEditor; +}; + +class CDLootMatrixIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDLootMatrixIndexTable(); + ~CDLootMatrixIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDLootMatrixTable.cpp b/dDatabase/Tables/CDLootMatrixTable.cpp index 17fd831..6d75b03 100644 --- a/dDatabase/Tables/CDLootMatrixTable.cpp +++ b/dDatabase/Tables/CDLootMatrixTable.cpp @@ -1,62 +1,50 @@ #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(); + } -//! Constructor -CDLootMatrixTable::CDLootMatrixTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootMatrix"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootMatrix"); - while (!tableData.eof()) { - CDLootMatrix entry; - entry.LootMatrixIndex = tableData.getIntField(0, -1); - entry.LootTableIndex = tableData.getIntField(1, -1); - entry.RarityTableIndex = tableData.getIntField(2, -1); - entry.percent = tableData.getFloatField(3, -1.0f); - entry.minToDrop = tableData.getIntField(4, -1); - entry.maxToDrop = tableData.getIntField(5, -1); - entry.id = tableData.getIntField(6, -1); - entry.flagID = tableData.getIntField(7, -1); - UNUSED(entry.gate_version = tableData.getStringField(8, "")); - - this->entries.push_back(entry); - tableData.nextRow(); - } + 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(); } -//! Destructor -CDLootMatrixTable::~CDLootMatrixTable(void) { } +CDLootMatrixTable::~CDLootMatrixTable() { +} -//! Returns the table's name std::string CDLootMatrixTable::GetName(void) const { - return "LootMatrix"; + return "LootMatrix"; } -//! Queries the table with a custom "where" clause std::vector CDLootMatrixTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table -const std::vector& CDLootMatrixTable::GetEntries(void) const { - return this->entries; +std::vector CDLootMatrixTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDLootMatrixTable.h b/dDatabase/Tables/CDLootMatrixTable.h index f306324..7689837 100644 --- a/dDatabase/Tables/CDLootMatrixTable.h +++ b/dDatabase/Tables/CDLootMatrixTable.h @@ -1,56 +1,27 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDLootMatrixTable.hpp - \brief Contains data for the ObjectSkills table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.107539 +//DO NOT EDIT THIS FILE MANUALLY! -//! LootMatrix Struct struct CDLootMatrix { - unsigned int LootMatrixIndex; //!< The Loot Matrix Index - unsigned int LootTableIndex; //!< The Loot Table Index - unsigned int RarityTableIndex; //!< The Rarity Table Index - float percent; //!< The percent that this matrix is used? - unsigned int minToDrop; //!< The minimum amount of loot from this matrix to drop - unsigned int maxToDrop; //!< The maximum amount of loot from this matrix to drop - unsigned int id; //!< The ID of the Loot Matrix - unsigned int flagID; //!< ??? - UNUSED(std::string gate_version); //!< The Gate Version + int LootMatrixIndex; + int LootTableIndex; + int RarityTableIndex; + float percent; + int minToDrop; + int maxToDrop; + int id; }; -//! MissionNPCComponent table class CDLootMatrixTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDLootMatrixTable(void); - - //! Destructor - ~CDLootMatrixTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - const std::vector& GetEntries(void) const; - -}; + CDLootMatrixTable(); + ~CDLootMatrixTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDLootTableIndexTable.cpp b/dDatabase/Tables/CDLootTableIndexTable.cpp new file mode 100644 index 0000000..92b1a55 --- /dev/null +++ b/dDatabase/Tables/CDLootTableIndexTable.cpp @@ -0,0 +1,45 @@ +#include "CDLootTableIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.128534 +//DO NOT EDIT THIS FILE MANUALLY! + +CDLootTableIndexTable::CDLootTableIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootTableIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootTableIndex"); + while (!tableData.eof()) { + CDLootTableIndex entry; + entry.LootTableIndex = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDLootTableIndexTable::~CDLootTableIndexTable() { +} + +std::string CDLootTableIndexTable::GetName(void) const { + return "LootTableIndex"; +} + +std::vector CDLootTableIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDLootTableIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDLootTableIndexTable.h b/dDatabase/Tables/CDLootTableIndexTable.h new file mode 100644 index 0000000..ad5c9e8 --- /dev/null +++ b/dDatabase/Tables/CDLootTableIndexTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.126067 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDLootTableIndex { + int LootTableIndex; + std::string description; +}; + +class CDLootTableIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDLootTableIndexTable(); + ~CDLootTableIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDLootTableTable.cpp b/dDatabase/Tables/CDLootTableTable.cpp index 62727ad..d7d17b2 100644 --- a/dDatabase/Tables/CDLootTableTable.cpp +++ b/dDatabase/Tables/CDLootTableTable.cpp @@ -1,59 +1,47 @@ #include "CDLootTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.123497 +//DO NOT EDIT THIS FILE MANUALLY! + +CDLootTableTable::CDLootTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDLootTableTable::CDLootTableTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM LootTable"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootTable"); - while (!tableData.eof()) { - CDLootTable entry; - entry.id = tableData.getIntField(0, -1); - entry.itemid = tableData.getIntField(0, -1); - entry.LootTableIndex = tableData.getIntField(1, -1); - entry.id = tableData.getIntField(2, -1); - entry.MissionDrop = tableData.getIntField(3, -1) == 1 ? true : false; - entry.sortPriority = tableData.getIntField(4, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM LootTable"); + while (!tableData.eof()) { + CDLootTable entry; + entry.itemid = tableData.getIntField(0, int{}); + entry.LootTableIndex = tableData.getIntField(1, int{}); + entry.id = tableData.getIntField(2, int{}); + entry.MissionDrop = tableData.getIntField(3, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDLootTableTable::~CDLootTableTable(void) { } +CDLootTableTable::~CDLootTableTable() { +} -//! Returns the table's name std::string CDLootTableTable::GetName(void) const { - return "LootTable"; + return "LootTable"; } -//! Queries the table with a custom "where" clause std::vector CDLootTableTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table -const std::vector& CDLootTableTable::GetEntries(void) const { - return this->entries; +std::vector CDLootTableTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDLootTableTable.h b/dDatabase/Tables/CDLootTableTable.h index 750adcb..d169159 100644 --- a/dDatabase/Tables/CDLootTableTable.h +++ b/dDatabase/Tables/CDLootTableTable.h @@ -1,52 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDLootTableTable.hpp - \brief Contains data for the LootTable table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.121834 +//DO NOT EDIT THIS FILE MANUALLY! -//! LootTable Struct struct CDLootTable { - unsigned int itemid; //!< The LOT of the item - unsigned int LootTableIndex; //!< The Loot Table Index - unsigned int id; //!< The ID - bool MissionDrop; //!< Whether or not this loot table is a mission drop - unsigned int sortPriority; //!< The sorting priority + int itemid; + int LootTableIndex; + int id; + bool MissionDrop; }; -//! LootTable table class CDLootTableTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDLootTableTable(void); - - //! Destructor - ~CDLootTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - const std::vector& GetEntries(void) const; - -}; + CDLootTableTable(); + ~CDLootTableTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMinifigComponentTable.cpp b/dDatabase/Tables/CDMinifigComponentTable.cpp new file mode 100644 index 0000000..b30991e --- /dev/null +++ b/dDatabase/Tables/CDMinifigComponentTable.cpp @@ -0,0 +1,56 @@ +#include "CDMinifigComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.187405 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMinifigComponentTable::CDMinifigComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MinifigComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MinifigComponent"); + while (!tableData.eof()) { + CDMinifigComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.head = tableData.getIntField(1, int{}); + entry.chest = tableData.getIntField(2, int{}); + entry.legs = tableData.getIntField(3, int{}); + entry.hairstyle = tableData.getIntField(4, int{}); + entry.haircolor = tableData.getIntField(5, int{}); + entry.chestdecal = tableData.getIntField(6, int{}); + entry.headcolor = tableData.getIntField(7, int{}); + entry.lefthand = tableData.getIntField(8, int{}); + entry.righthand = tableData.getIntField(9, int{}); + entry.eyebrowstyle = tableData.getIntField(10, int{}); + entry.eyesstyle = tableData.getIntField(11, int{}); + entry.mouthstyle = tableData.getIntField(12, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMinifigComponentTable::~CDMinifigComponentTable() { +} + +std::string CDMinifigComponentTable::GetName(void) const { + return "MinifigComponent"; +} + +std::vector CDMinifigComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMinifigComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMinifigComponentTable.h b/dDatabase/Tables/CDMinifigComponentTable.h new file mode 100644 index 0000000..963174a --- /dev/null +++ b/dDatabase/Tables/CDMinifigComponentTable.h @@ -0,0 +1,33 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.185562 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMinifigComponent { + int id; + int head; + int chest; + int legs; + int hairstyle; + int haircolor; + int chestdecal; + int headcolor; + int lefthand; + int righthand; + int eyebrowstyle; + int eyesstyle; + int mouthstyle; +}; + +class CDMinifigComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDMinifigComponentTable(); + ~CDMinifigComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.cpp b/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.cpp new file mode 100644 index 0000000..407a6ae --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.cpp @@ -0,0 +1,49 @@ +#include "CDMinifigDecals_EyebrowsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.191375 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMinifigDecals_EyebrowsTable::CDMinifigDecals_EyebrowsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MinifigDecals_Eyebrows"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MinifigDecals_Eyebrows"); + while (!tableData.eof()) { + CDMinifigDecals_Eyebrows entry; + entry.ID = tableData.getIntField(0, int{}); + entry.High_path = tableData.getStringField(1, std::string{}.c_str()); + entry.Low_path = tableData.getStringField(2, std::string{}.c_str()); + entry.CharacterCreateValid = tableData.getIntField(3, bool{}); + entry.male = tableData.getIntField(4, bool{}); + entry.female = tableData.getIntField(5, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMinifigDecals_EyebrowsTable::~CDMinifigDecals_EyebrowsTable() { +} + +std::string CDMinifigDecals_EyebrowsTable::GetName(void) const { + return "MinifigDecals_Eyebrows"; +} + +std::vector CDMinifigDecals_EyebrowsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMinifigDecals_EyebrowsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.h b/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.h new file mode 100644 index 0000000..a101440 --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_EyebrowsTable.h @@ -0,0 +1,26 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.190339 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMinifigDecals_Eyebrows { + int ID; + std::string High_path; + std::string Low_path; + bool CharacterCreateValid; + bool male; + bool female; +}; + +class CDMinifigDecals_EyebrowsTable : public CDTable { +private: + std::vector m_entries; +public: + CDMinifigDecals_EyebrowsTable(); + ~CDMinifigDecals_EyebrowsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMinifigDecals_EyesTable.cpp b/dDatabase/Tables/CDMinifigDecals_EyesTable.cpp new file mode 100644 index 0000000..bcc3452 --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_EyesTable.cpp @@ -0,0 +1,49 @@ +#include "CDMinifigDecals_EyesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.198297 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMinifigDecals_EyesTable::CDMinifigDecals_EyesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MinifigDecals_Eyes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MinifigDecals_Eyes"); + while (!tableData.eof()) { + CDMinifigDecals_Eyes entry; + entry.ID = tableData.getIntField(0, int{}); + entry.High_path = tableData.getStringField(1, std::string{}.c_str()); + entry.Low_path = tableData.getStringField(2, std::string{}.c_str()); + entry.CharacterCreateValid = tableData.getIntField(3, bool{}); + entry.male = tableData.getIntField(4, bool{}); + entry.female = tableData.getIntField(5, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMinifigDecals_EyesTable::~CDMinifigDecals_EyesTable() { +} + +std::string CDMinifigDecals_EyesTable::GetName(void) const { + return "MinifigDecals_Eyes"; +} + +std::vector CDMinifigDecals_EyesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMinifigDecals_EyesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMinifigDecals_EyesTable.h b/dDatabase/Tables/CDMinifigDecals_EyesTable.h new file mode 100644 index 0000000..311b517 --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_EyesTable.h @@ -0,0 +1,26 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.196303 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMinifigDecals_Eyes { + int ID; + std::string High_path; + std::string Low_path; + bool CharacterCreateValid; + bool male; + bool female; +}; + +class CDMinifigDecals_EyesTable : public CDTable { +private: + std::vector m_entries; +public: + CDMinifigDecals_EyesTable(); + ~CDMinifigDecals_EyesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMinifigDecals_MouthsTable.cpp b/dDatabase/Tables/CDMinifigDecals_MouthsTable.cpp new file mode 100644 index 0000000..32b5bcc --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_MouthsTable.cpp @@ -0,0 +1,49 @@ +#include "CDMinifigDecals_MouthsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.202287 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMinifigDecals_MouthsTable::CDMinifigDecals_MouthsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MinifigDecals_Mouths"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MinifigDecals_Mouths"); + while (!tableData.eof()) { + CDMinifigDecals_Mouths entry; + entry.ID = tableData.getIntField(0, int{}); + entry.High_path = tableData.getStringField(1, std::string{}.c_str()); + entry.Low_path = tableData.getStringField(2, std::string{}.c_str()); + entry.CharacterCreateValid = tableData.getIntField(3, bool{}); + entry.male = tableData.getIntField(4, bool{}); + entry.female = tableData.getIntField(5, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMinifigDecals_MouthsTable::~CDMinifigDecals_MouthsTable() { +} + +std::string CDMinifigDecals_MouthsTable::GetName(void) const { + return "MinifigDecals_Mouths"; +} + +std::vector CDMinifigDecals_MouthsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMinifigDecals_MouthsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMinifigDecals_MouthsTable.h b/dDatabase/Tables/CDMinifigDecals_MouthsTable.h new file mode 100644 index 0000000..9a16810 --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_MouthsTable.h @@ -0,0 +1,26 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.201289 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMinifigDecals_Mouths { + int ID; + std::string High_path; + std::string Low_path; + bool CharacterCreateValid; + bool male; + bool female; +}; + +class CDMinifigDecals_MouthsTable : public CDTable { +private: + std::vector m_entries; +public: + CDMinifigDecals_MouthsTable(); + ~CDMinifigDecals_MouthsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMinifigDecals_TorsosTable.cpp b/dDatabase/Tables/CDMinifigDecals_TorsosTable.cpp new file mode 100644 index 0000000..4f72304 --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_TorsosTable.cpp @@ -0,0 +1,49 @@ +#include "CDMinifigDecals_TorsosTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.206276 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMinifigDecals_TorsosTable::CDMinifigDecals_TorsosTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MinifigDecals_Torsos"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MinifigDecals_Torsos"); + while (!tableData.eof()) { + CDMinifigDecals_Torsos entry; + entry.ID = tableData.getIntField(0, int{}); + entry.High_path = tableData.getStringField(1, std::string{}.c_str()); + entry.CharacterCreateValid = tableData.getIntField(2, bool{}); + entry._description = tableData.getStringField(3, std::string{}.c_str()); + entry.male = tableData.getIntField(4, bool{}); + entry.female = tableData.getIntField(5, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMinifigDecals_TorsosTable::~CDMinifigDecals_TorsosTable() { +} + +std::string CDMinifigDecals_TorsosTable::GetName(void) const { + return "MinifigDecals_Torsos"; +} + +std::vector CDMinifigDecals_TorsosTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMinifigDecals_TorsosTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMinifigDecals_TorsosTable.h b/dDatabase/Tables/CDMinifigDecals_TorsosTable.h new file mode 100644 index 0000000..bffbfec --- /dev/null +++ b/dDatabase/Tables/CDMinifigDecals_TorsosTable.h @@ -0,0 +1,26 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.205280 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMinifigDecals_Torsos { + int ID; + std::string High_path; + bool CharacterCreateValid; + std::string _description; + bool male; + bool female; +}; + +class CDMinifigDecals_TorsosTable : public CDTable { +private: + std::vector m_entries; +public: + CDMinifigDecals_TorsosTable(); + ~CDMinifigDecals_TorsosTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMissionEmailTable.cpp b/dDatabase/Tables/CDMissionEmailTable.cpp deleted file mode 100644 index 2c5fc56..0000000 --- a/dDatabase/Tables/CDMissionEmailTable.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "CDMissionEmailTable.h" - -//! Constructor -CDMissionEmailTable::CDMissionEmailTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MissionEmail"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionEmail"); - while (!tableData.eof()) { - CDMissionEmail entry; - entry.ID = tableData.getIntField(0, -1); - entry.messageType = tableData.getIntField(1, -1); - entry.notificationGroup = tableData.getIntField(2, -1); - entry.missionID = tableData.getIntField(3, -1); - entry.attachmentLOT = tableData.getIntField(4, 0); - entry.localize = (bool)tableData.getIntField(5, -1); - entry.locStatus = tableData.getIntField(6, -1); - entry.gate_version = tableData.getStringField(7, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDMissionEmailTable::~CDMissionEmailTable(void) { } - -//! Returns the table's name -std::string CDMissionEmailTable::GetName(void) const { - return "MissionEmail"; -} - -//! Queries the table with a custom "where" clause -std::vector CDMissionEmailTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -//! Gets all the entries in the table -std::vector CDMissionEmailTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDMissionEmailTable.h b/dDatabase/Tables/CDMissionEmailTable.h deleted file mode 100644 index cd0a128..0000000 --- a/dDatabase/Tables/CDMissionEmailTable.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDMissionEmailTable.hpp - \brief Contains data for the MissionEmail table - */ - - //! MissionEmail Entry Struct -struct CDMissionEmail { - unsigned int ID; - unsigned int messageType; - unsigned int notificationGroup; - unsigned int missionID; - unsigned int attachmentLOT; - bool localize; - unsigned int locStatus; - std::string gate_version; -}; - - -//! MissionEmail table -class CDMissionEmailTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDMissionEmailTable(void); - - //! Destructor - ~CDMissionEmailTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; diff --git a/dDatabase/Tables/CDMissionNPCComponentTable.cpp b/dDatabase/Tables/CDMissionNPCComponentTable.cpp deleted file mode 100644 index 9014585..0000000 --- a/dDatabase/Tables/CDMissionNPCComponentTable.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "CDMissionNPCComponentTable.h" - -//! Constructor -CDMissionNPCComponentTable::CDMissionNPCComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MissionNPCComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionNPCComponent"); - while (!tableData.eof()) { - CDMissionNPCComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.missionID = tableData.getIntField(1, -1); - entry.offersMission = tableData.getIntField(2, -1) == 1 ? true : false; - entry.acceptsMission = tableData.getIntField(3, -1) == 1 ? true : false; - entry.gate_version = tableData.getStringField(4, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDMissionNPCComponentTable::~CDMissionNPCComponentTable(void) { } - -//! Returns the table's name -std::string CDMissionNPCComponentTable::GetName(void) const { - return "MissionNPCComponent"; -} - -//! Queries the table with a custom "where" clause -std::vector CDMissionNPCComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -//! Gets all the entries in the table -std::vector CDMissionNPCComponentTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDMissionNPCComponentTable.h b/dDatabase/Tables/CDMissionNPCComponentTable.h deleted file mode 100644 index a31ba17..0000000 --- a/dDatabase/Tables/CDMissionNPCComponentTable.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDMissionNPCComponentTable.hpp - \brief Contains data for the ObjectSkills table - */ - -//! MissionNPCComponent Struct -struct CDMissionNPCComponent { - unsigned int id; //!< The ID - unsigned int missionID; //!< The Mission ID - bool offersMission; //!< Whether or not this NPC offers a mission - bool acceptsMission; //!< Whether or not this NPC accepts a mission - std::string gate_version; //!< The gate version -}; - -//! MissionNPCComponent table -class CDMissionNPCComponentTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDMissionNPCComponentTable(void); - - //! Destructor - ~CDMissionNPCComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; - diff --git a/dDatabase/Tables/CDMissionTasksTable.cpp b/dDatabase/Tables/CDMissionTasksTable.cpp index e79e6d0..06623ba 100644 --- a/dDatabase/Tables/CDMissionTasksTable.cpp +++ b/dDatabase/Tables/CDMissionTasksTable.cpp @@ -1,83 +1,54 @@ #include "CDMissionTasksTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.216250 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMissionTasksTable::CDMissionTasksTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MissionTasks"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDMissionTasksTable::CDMissionTasksTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MissionTasks"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionTasks"); - while (!tableData.eof()) { - CDMissionTasks entry; - entry.id = tableData.getIntField(0, -1); - UNUSED(entry.locStatus = tableData.getIntField(1, -1)); - entry.taskType = tableData.getIntField(2, -1); - entry.target = tableData.getIntField(3, -1); - entry.targetGroup = tableData.getStringField(4, ""); - entry.targetValue = tableData.getIntField(5, -1); - entry.taskParam1 = tableData.getStringField(6, ""); - UNUSED(entry.largeTaskIcon = tableData.getStringField(7, "")); - UNUSED(entry.IconID = tableData.getIntField(8, -1)); - entry.uid = tableData.getIntField(9, -1); - UNUSED(entry.largeTaskIconID = tableData.getIntField(10, -1)); - UNUSED(entry.localize = tableData.getIntField(11, -1) == 1 ? true : false); - UNUSED(entry.gate_version = tableData.getStringField(12, "")); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionTasks"); + while (!tableData.eof()) { + CDMissionTasks entry; + entry.id = tableData.getIntField(0, int{}); + entry.taskType = tableData.getIntField(1, int{}); + entry.target = tableData.getIntField(2, int{}); + entry.targetGroup = tableData.getStringField(3, std::string{}.c_str()); + entry.targetValue = tableData.getIntField(4, int{}); + entry.taskParam1 = tableData.getStringField(5, std::string{}.c_str()); + entry.description = tableData.getStringField(6, std::string{}.c_str()); + entry.largeTaskIcon = tableData.getStringField(7, std::string{}.c_str()); + entry.IconID = tableData.getIntField(8, int{}); + entry.uid = tableData.getIntField(9, int{}); + entry.largeTaskIconID = tableData.getIntField(10, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDMissionTasksTable::~CDMissionTasksTable(void) { } +CDMissionTasksTable::~CDMissionTasksTable() { +} -//! Returns the table's name std::string CDMissionTasksTable::GetName(void) const { - return "MissionTasks"; + return "MissionTasks"; } -//! Queries the table with a custom "where" clause std::vector CDMissionTasksTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -std::vector CDMissionTasksTable::GetByMissionID(uint32_t missionID) -{ - std::vector tasks; - - for (auto& entry : this->entries) - { - if (entry.id == missionID) - { - CDMissionTasks* task = const_cast(&entry); - - tasks.push_back(task); - } - } - - return tasks; -} - -//! Gets all the entries in the table -const std::vector& CDMissionTasksTable::GetEntries(void) const { - return this->entries; +std::vector CDMissionTasksTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDMissionTasksTable.h b/dDatabase/Tables/CDMissionTasksTable.h index af84663..3519d79 100644 --- a/dDatabase/Tables/CDMissionTasksTable.h +++ b/dDatabase/Tables/CDMissionTasksTable.h @@ -1,61 +1,31 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDMissionTasksTable.hpp - \brief Contains data for the MissionTasks table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.215253 +//DO NOT EDIT THIS FILE MANUALLY! -//! ObjectSkills Struct struct CDMissionTasks { - unsigned int id; //!< The Mission ID that the task belongs to - UNUSED(unsigned int locStatus); //!< ??? - unsigned int taskType; //!< The task type - unsigned int target; //!< The mission target - std::string targetGroup; //!< The mission target group - int targetValue; //!< The target value - std::string taskParam1; //!< The task param 1 - UNUSED(std::string largeTaskIcon); //!< ??? - UNUSED(unsigned int IconID); //!< ??? - unsigned int uid; //!< ??? - UNUSED(unsigned int largeTaskIconID); //!< ??? - UNUSED(bool localize); //!< Whether or not the task should be localized - UNUSED(std::string gate_version); //!< ??? + int id; + int taskType; + int target; + std::string targetGroup; + int targetValue; + std::string taskParam1; + std::string description; + std::string largeTaskIcon; + int IconID; + int uid; + int largeTaskIconID; }; -//! ObjectSkills table class CDMissionTasksTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDMissionTasksTable(void); - - //! Destructor - ~CDMissionTasksTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); + CDMissionTasksTable(); + ~CDMissionTasksTable(); + std::string GetName(void) const override; - std::vector GetByMissionID(uint32_t missionID); - - //! Gets all the entries in the table - /*! - \return The entries - */ - const std::vector& GetEntries(void) const; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDMissionTextTable.cpp b/dDatabase/Tables/CDMissionTextTable.cpp new file mode 100644 index 0000000..fa47637 --- /dev/null +++ b/dDatabase/Tables/CDMissionTextTable.cpp @@ -0,0 +1,85 @@ +#include "CDMissionTextTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.220239 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMissionTextTable::CDMissionTextTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MissionText"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MissionText"); + while (!tableData.eof()) { + CDMissionText entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.offer = tableData.getStringField(2, std::string{}.c_str()); + entry.in_progress = tableData.getStringField(3, std::string{}.c_str()); + entry.ready_to_complete = tableData.getStringField(4, std::string{}.c_str()); + entry.story_icon = tableData.getStringField(5, std::string{}.c_str()); + entry.completion_fail_tip = tableData.getStringField(6, std::string{}.c_str()); + entry.completion_succeed_tip = tableData.getStringField(7, std::string{}.c_str()); + entry.chat_state_1 = tableData.getStringField(8, std::string{}.c_str()); + entry.chat_state_2 = tableData.getStringField(9, std::string{}.c_str()); + entry.chat_state_3 = tableData.getStringField(10, std::string{}.c_str()); + entry.chat_state_4 = tableData.getStringField(11, std::string{}.c_str()); + entry.missionIcon = tableData.getStringField(12, std::string{}.c_str()); + entry.offerNPCIcon = tableData.getStringField(13, std::string{}.c_str()); + entry.IconID = tableData.getIntField(14, int{}); + entry.accept_chat_bubble = tableData.getStringField(15, std::string{}.c_str()); + entry.offer_repeatable = tableData.getStringField(16, std::string{}.c_str()); + entry.bubble_prereq_not_met = tableData.getStringField(17, std::string{}.c_str()); + entry.chat_state_3_turnin = tableData.getStringField(18, std::string{}.c_str()); + entry.chat_state_4_turnin = tableData.getStringField(19, std::string{}.c_str()); + entry.state_1_anim = tableData.getStringField(20, std::string{}.c_str()); + entry.state_2_anim = tableData.getStringField(21, std::string{}.c_str()); + entry.state_3_anim = tableData.getStringField(22, std::string{}.c_str()); + entry.state_4_anim = tableData.getStringField(23, std::string{}.c_str()); + entry.state_3_turnin_anim = tableData.getStringField(24, std::string{}.c_str()); + entry.state_4_turnin_anim = tableData.getStringField(25, std::string{}.c_str()); + entry.onclick_anim = tableData.getStringField(26, std::string{}.c_str()); + entry.CinematicAccepted = tableData.getStringField(27, std::string{}.c_str()); + entry.CinematicAcceptedLeadin = tableData.getFloatField(28, float{}); + entry.CinematicCompleted = tableData.getStringField(29, std::string{}.c_str()); + entry.CinematicCompletedLeadin = tableData.getFloatField(30, float{}); + entry.CinematicRepeatable = tableData.getStringField(31, std::string{}.c_str()); + entry.CinematicRepeatableLeadin = tableData.getFloatField(32, float{}); + entry.CinematicRepeatableCompleted = tableData.getStringField(33, std::string{}.c_str()); + entry.CinematicRepeatableCompletedLeadin = tableData.getFloatField(34, float{}); + entry.AudioEventGUID_Interact = tableData.getStringField(35, std::string{}.c_str()); + entry.AudioEventGUID_OfferAccept = tableData.getStringField(36, std::string{}.c_str()); + entry.AudioEventGUID_OfferDeny = tableData.getStringField(37, std::string{}.c_str()); + entry.AudioEventGUID_Completed = tableData.getStringField(38, std::string{}.c_str()); + entry.AudioEventGUID_TurnIn = tableData.getStringField(39, std::string{}.c_str()); + entry.AudioEventGUID_Failed = tableData.getStringField(40, std::string{}.c_str()); + entry.AudioEventGUID_Progress = tableData.getStringField(41, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMissionTextTable::~CDMissionTextTable() { +} + +std::string CDMissionTextTable::GetName(void) const { + return "MissionText"; +} + +std::vector CDMissionTextTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMissionTextTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMissionTextTable.h b/dDatabase/Tables/CDMissionTextTable.h new file mode 100644 index 0000000..cf6470e --- /dev/null +++ b/dDatabase/Tables/CDMissionTextTable.h @@ -0,0 +1,62 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.218255 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMissionText { + int id; + std::string description; + std::string offer; + std::string in_progress; + std::string ready_to_complete; + std::string story_icon; + std::string completion_fail_tip; + std::string completion_succeed_tip; + std::string chat_state_1; + std::string chat_state_2; + std::string chat_state_3; + std::string chat_state_4; + std::string missionIcon; + std::string offerNPCIcon; + int IconID; + std::string accept_chat_bubble; + std::string offer_repeatable; + std::string bubble_prereq_not_met; + std::string chat_state_3_turnin; + std::string chat_state_4_turnin; + std::string state_1_anim; + std::string state_2_anim; + std::string state_3_anim; + std::string state_4_anim; + std::string state_3_turnin_anim; + std::string state_4_turnin_anim; + std::string onclick_anim; + std::string CinematicAccepted; + float CinematicAcceptedLeadin; + std::string CinematicCompleted; + float CinematicCompletedLeadin; + std::string CinematicRepeatable; + float CinematicRepeatableLeadin; + std::string CinematicRepeatableCompleted; + float CinematicRepeatableCompletedLeadin; + std::string AudioEventGUID_Interact; + std::string AudioEventGUID_OfferAccept; + std::string AudioEventGUID_OfferDeny; + std::string AudioEventGUID_Completed; + std::string AudioEventGUID_TurnIn; + std::string AudioEventGUID_Failed; + std::string AudioEventGUID_Progress; +}; + +class CDMissionTextTable : public CDTable { +private: + std::vector m_entries; +public: + CDMissionTextTable(); + ~CDMissionTextTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMissionsTable.cpp b/dDatabase/Tables/CDMissionsTable.cpp index 58243bd..fe46522 100644 --- a/dDatabase/Tables/CDMissionsTable.cpp +++ b/dDatabase/Tables/CDMissionsTable.cpp @@ -1,139 +1,85 @@ #include "CDMissionsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.212261 +//DO NOT EDIT THIS FILE MANUALLY! -CDMissions CDMissionsTable::Default = {}; +CDMissionsTable::CDMissionsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Missions"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDMissionsTable::CDMissionsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Missions"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Missions"); - while (!tableData.eof()) { - CDMissions entry; - entry.id = tableData.getIntField(0, -1); - entry.defined_type = tableData.getStringField(1, ""); - entry.defined_subtype = tableData.getStringField(2, ""); - entry.UISortOrder = tableData.getIntField(3, -1); - entry.offer_objectID = tableData.getIntField(4, -1); - entry.target_objectID = tableData.getIntField(5, -1); - entry.reward_currency = tableData.getInt64Field(6, -1); - entry.LegoScore = tableData.getIntField(7, -1); - entry.reward_reputation = tableData.getIntField(8, -1); - entry.isChoiceReward = tableData.getIntField(9, -1) == 1 ? true : false; - entry.reward_item1 = tableData.getIntField(10, 0); - entry.reward_item1_count = tableData.getIntField(11, 0); - entry.reward_item2 = tableData.getIntField(12, 0); - entry.reward_item2_count = tableData.getIntField(13, 0); - entry.reward_item3 = tableData.getIntField(14, 0); - entry.reward_item3_count = tableData.getIntField(15, 0); - entry.reward_item4 = tableData.getIntField(16, 0); - entry.reward_item4_count = tableData.getIntField(17, 0); - entry.reward_emote = tableData.getIntField(18, -1); - entry.reward_emote2 = tableData.getIntField(19, -1); - entry.reward_emote3 = tableData.getIntField(20, -1); - entry.reward_emote4 = tableData.getIntField(21, -1); - entry.reward_maximagination = tableData.getIntField(22, -1); - entry.reward_maxhealth = tableData.getIntField(23, -1); - entry.reward_maxinventory = tableData.getIntField(24, -1); - entry.reward_maxmodel = tableData.getIntField(25, -1); - entry.reward_maxwidget = tableData.getIntField(26, -1); - entry.reward_maxwallet = tableData.getIntField(27, -1); - entry.repeatable = tableData.getIntField(28, -1) == 1 ? true : false; - entry.reward_currency_repeatable = tableData.getIntField(29, -1); - entry.reward_item1_repeatable = tableData.getIntField(30, -1); - entry.reward_item1_repeat_count = tableData.getIntField(31, -1); - entry.reward_item2_repeatable = tableData.getIntField(32, -1); - entry.reward_item2_repeat_count = tableData.getIntField(33, -1); - entry.reward_item3_repeatable = tableData.getIntField(34, -1); - entry.reward_item3_repeat_count = tableData.getIntField(35, -1); - entry.reward_item4_repeatable = tableData.getIntField(36, -1); - entry.reward_item4_repeat_count = tableData.getIntField(37, -1); - entry.time_limit = tableData.getIntField(38, -1); - entry.isMission = tableData.getIntField(39, -1) ? true : false; - entry.missionIconID = tableData.getIntField(40, -1); - entry.prereqMissionID = tableData.getStringField(41, ""); - entry.localize = tableData.getIntField(42, -1) == 1 ? true : false; - entry.inMOTD = tableData.getIntField(43, -1) == 1 ? true : false; - entry.cooldownTime = tableData.getInt64Field(44, -1); - entry.isRandom = tableData.getIntField(45, -1) == 1 ? true : false; - entry.randomPool = tableData.getStringField(46, ""); - entry.UIPrereqID = tableData.getIntField(47, -1); - UNUSED(entry.gate_version = tableData.getStringField(48, "")); - UNUSED(entry.HUDStates = tableData.getStringField(49, "")); - UNUSED(entry.locStatus = tableData.getIntField(50, -1)); - entry.reward_bankinventory = tableData.getIntField(51, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Missions"); + while (!tableData.eof()) { + CDMissions entry; + entry.id = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + entry.defined_type = tableData.getStringField(2, std::string{}.c_str()); + entry.defined_subtype = tableData.getStringField(3, std::string{}.c_str()); + entry.offer_objectID = tableData.getIntField(4, int{}); + entry.target_objectID = tableData.getIntField(5, int{}); + entry.reward_currency = tableData.getInt64Field(6, uint64_t{}); + entry.LegoScore = tableData.getIntField(7, int{}); + entry.reward_reputation = tableData.getInt64Field(8, uint64_t{}); + entry.isChoiceReward = tableData.getIntField(9, bool{}); + entry.reward_item1 = tableData.getIntField(10, int{}); + entry.reward_item1_count = tableData.getIntField(11, int{}); + entry.reward_item2 = tableData.getIntField(12, int{}); + entry.reward_item2_count = tableData.getIntField(13, int{}); + entry.reward_item3 = tableData.getIntField(14, int{}); + entry.reward_item3_count = tableData.getIntField(15, int{}); + entry.reward_item4 = tableData.getIntField(16, int{}); + entry.reward_item4_count = tableData.getIntField(17, int{}); + entry.reward_emote = tableData.getIntField(18, int{}); + entry.reward_emote2 = tableData.getIntField(19, int{}); + entry.reward_emote3 = tableData.getIntField(20, int{}); + entry.reward_emote4 = tableData.getIntField(21, int{}); + entry.reward_maximagination = tableData.getIntField(22, int{}); + entry.reward_maxhealth = tableData.getIntField(23, int{}); + entry.reward_maxinventory = tableData.getIntField(24, int{}); + entry.reward_maxmodel = tableData.getIntField(25, int{}); + entry.reward_maxwidget = tableData.getIntField(26, int{}); + entry.reward_maxwallet = tableData.getInt64Field(27, uint64_t{}); + entry.repeatable = tableData.getIntField(28, bool{}); + entry.reward_currency_repeatable = tableData.getInt64Field(29, uint64_t{}); + entry.reward_item1_repeatable = tableData.getIntField(30, int{}); + entry.reward_item1_repeat_count = tableData.getIntField(31, int{}); + entry.reward_item2_repeatable = tableData.getIntField(32, int{}); + entry.reward_item2_repeat_count = tableData.getIntField(33, int{}); + entry.reward_item3_repeatable = tableData.getIntField(34, int{}); + entry.reward_item3_repeat_count = tableData.getIntField(35, int{}); + entry.reward_item4_repeatable = tableData.getIntField(36, int{}); + entry.reward_item4_repeat_count = tableData.getIntField(37, int{}); + entry.requirement_mission = tableData.getIntField(38, int{}); + entry.time_limit = tableData.getIntField(39, int{}); + entry.isMission = tableData.getIntField(40, bool{}); + entry.missionIconID = tableData.getIntField(41, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); - - Default.id = -1; } -//! Destructor -CDMissionsTable::~CDMissionsTable(void) { } +CDMissionsTable::~CDMissionsTable() { +} -//! Returns the table's name std::string CDMissionsTable::GetName(void) const { - return "Missions"; + return "Missions"; } -//! Queries the table with a custom "where" clause std::vector CDMissionsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table -const std::vector& CDMissionsTable::GetEntries(void) const { - return this->entries; -} - -const CDMissions* CDMissionsTable::GetPtrByMissionID(uint32_t missionID) const -{ - for (const auto& entry : entries) - { - if (entry.id == missionID) - { - return const_cast(&entry); - } - } - - return &Default; -} - -const CDMissions& CDMissionsTable::GetByMissionID(uint32_t missionID, bool& found) const -{ - for (const auto& entry : entries) - { - if (entry.id == missionID) - { - found = true; - - return entry; - } - } - - found = false; - - return Default; +std::vector CDMissionsTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDMissionsTable.h b/dDatabase/Tables/CDMissionsTable.h index c083bd3..173b43a 100644 --- a/dDatabase/Tables/CDMissionsTable.h +++ b/dDatabase/Tables/CDMissionsTable.h @@ -1,105 +1,62 @@ #pragma once - -// Custom Classes #include "CDTable.h" -#include -/*! - \file CDMissionsTable.hpp - \brief Contains data for the Missions table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.210761 +//DO NOT EDIT THIS FILE MANUALLY! -//! Missions Struct struct CDMissions { - int id; //!< The Mission ID - std::string defined_type; //!< The type of mission - std::string defined_subtype; //!< The subtype of the mission - int UISortOrder; //!< The UI Sort Order for the mission - int offer_objectID; //!< The LOT of the mission giver - int target_objectID; //!< The LOT of the mission's target - __int64 reward_currency; //!< The amount of currency to reward the player - int LegoScore; //!< The amount of LEGO Score to reward the player - __int64 reward_reputation; //!< The reputation to award the player - bool isChoiceReward; //!< Whether or not the user has the option to choose their loot - int reward_item1; //!< The first rewarded item - int reward_item1_count; //!< The count of the first item to be rewarded - int reward_item2; //!< The second rewarded item - int reward_item2_count; //!< The count of the second item to be rewarded - int reward_item3; //!< The third rewarded item - int reward_item3_count; //!< The count of the third item to be rewarded - int reward_item4; //!< The fourth rewarded item - int reward_item4_count; //!< The count of the fourth item to be rewarded - int reward_emote; //!< The first emote to be rewarded - int reward_emote2; //!< The second emote to be rewarded - int reward_emote3; //!< The third emote to be rewarded - int reward_emote4; //!< The fourth emote to be rewarded - int reward_maximagination; //!< The amount of max imagination to reward - int reward_maxhealth; //!< The amount of max health to reward - int reward_maxinventory; //!< The amount of max inventory to reward - int reward_maxmodel; //!< ??? - int reward_maxwidget; //!< ??? - int reward_maxwallet; //!< ??? - bool repeatable; //!< Whether or not this mission can be repeated (for instance, is it a daily mission) - __int64 reward_currency_repeatable; //!< The repeatable reward - int reward_item1_repeatable; //!< The first rewarded item - int reward_item1_repeat_count; //!< The count of the first item to be rewarded - int reward_item2_repeatable; //!< The second rewarded item - int reward_item2_repeat_count; //!< The count of the second item to be rewarded - int reward_item3_repeatable; //!< The third rewarded item - int reward_item3_repeat_count; //!< The count of the third item to be rewarded - int reward_item4_repeatable; //!< The fourth rewarded item - int reward_item4_repeat_count; //!< The count of the fourth item to be rewarded - int time_limit; //!< The time limit of the mission - bool isMission; //!< Maybe to differentiate between missions and achievements? - int missionIconID; //!< The mission icon ID - std::string prereqMissionID; //!< A '|' seperated list of prerequisite missions - bool localize; //!< Whether or not to localize the mission - bool inMOTD; //!< In Match of the Day(?) - __int64 cooldownTime; //!< The mission cooldown time - bool isRandom; //!< ??? - std::string randomPool; //!< ??? - int UIPrereqID; //!< ??? - UNUSED(std::string gate_version); //!< The gate version - UNUSED(std::string HUDStates); //!< ??? - UNUSED(int locStatus); //!< ??? - int reward_bankinventory; //!< The amount of bank space this mission rewards + int id; + std::string name; + std::string defined_type; + std::string defined_subtype; + int offer_objectID; + int target_objectID; + uint64_t reward_currency; + int LegoScore; + uint64_t reward_reputation; + bool isChoiceReward; + int reward_item1; + int reward_item1_count; + int reward_item2; + int reward_item2_count; + int reward_item3; + int reward_item3_count; + int reward_item4; + int reward_item4_count; + int reward_emote; + int reward_emote2; + int reward_emote3; + int reward_emote4; + int reward_maximagination; + int reward_maxhealth; + int reward_maxinventory; + int reward_maxmodel; + int reward_maxwidget; + uint64_t reward_maxwallet; + bool repeatable; + uint64_t reward_currency_repeatable; + int reward_item1_repeatable; + int reward_item1_repeat_count; + int reward_item2_repeatable; + int reward_item2_repeat_count; + int reward_item3_repeatable; + int reward_item3_repeat_count; + int reward_item4_repeatable; + int reward_item4_repeat_count; + int requirement_mission; + int time_limit; + bool isMission; + int missionIconID; }; -//! Missions table class CDMissionsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDMissionsTable(void); - - //! Destructor - ~CDMissionsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); + CDMissionsTable(); + ~CDMissionsTable(); + std::string GetName(void) const override; - //! Gets all the entries in the table - /*! - \return The entries - */ - const std::vector& GetEntries(void) const; - - const CDMissions* GetPtrByMissionID(uint32_t missionID) const; - - const CDMissions& GetByMissionID(uint32_t missionID, bool& found) const; - - static CDMissions Default; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDModelBehaviorTable.cpp b/dDatabase/Tables/CDModelBehaviorTable.cpp new file mode 100644 index 0000000..3eb1409 --- /dev/null +++ b/dDatabase/Tables/CDModelBehaviorTable.cpp @@ -0,0 +1,45 @@ +#include "CDModelBehaviorTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.225231 +//DO NOT EDIT THIS FILE MANUALLY! + +CDModelBehaviorTable::CDModelBehaviorTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ModelBehavior"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ModelBehavior"); + while (!tableData.eof()) { + CDModelBehavior entry; + entry.id = tableData.getIntField(0, int{}); + entry.definitionXMLfilename = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDModelBehaviorTable::~CDModelBehaviorTable() { +} + +std::string CDModelBehaviorTable::GetName(void) const { + return "ModelBehavior"; +} + +std::vector CDModelBehaviorTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDModelBehaviorTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDModelBehaviorTable.h b/dDatabase/Tables/CDModelBehaviorTable.h new file mode 100644 index 0000000..ed6fa96 --- /dev/null +++ b/dDatabase/Tables/CDModelBehaviorTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.224228 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDModelBehavior { + int id; + std::string definitionXMLfilename; +}; + +class CDModelBehaviorTable : public CDTable { +private: + std::vector m_entries; +public: + CDModelBehaviorTable(); + ~CDModelBehaviorTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDModularBuildComponentTable.cpp b/dDatabase/Tables/CDModularBuildComponentTable.cpp new file mode 100644 index 0000000..de7b672 --- /dev/null +++ b/dDatabase/Tables/CDModularBuildComponentTable.cpp @@ -0,0 +1,48 @@ +#include "CDModularBuildComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.229216 +//DO NOT EDIT THIS FILE MANUALLY! + +CDModularBuildComponentTable::CDModularBuildComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ModularBuildComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ModularBuildComponent"); + while (!tableData.eof()) { + CDModularBuildComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.buildType = tableData.getIntField(1, int{}); + entry.xml = tableData.getStringField(2, ""); + entry.createdLOT = tableData.getIntField(3, int{}); + entry.createdPhysicsID = tableData.getIntField(4, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDModularBuildComponentTable::~CDModularBuildComponentTable() { +} + +std::string CDModularBuildComponentTable::GetName(void) const { + return "ModularBuildComponent"; +} + +std::vector CDModularBuildComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDModularBuildComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDModularBuildComponentTable.h b/dDatabase/Tables/CDModularBuildComponentTable.h new file mode 100644 index 0000000..9a79027 --- /dev/null +++ b/dDatabase/Tables/CDModularBuildComponentTable.h @@ -0,0 +1,25 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.228217 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDModularBuildComponent { + int id; + int buildType; + std::string xml; + int createdLOT; + int createdPhysicsID; +}; + +class CDModularBuildComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDModularBuildComponentTable(); + ~CDModularBuildComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMotionFXTable.cpp b/dDatabase/Tables/CDMotionFXTable.cpp new file mode 100644 index 0000000..7ceeffe --- /dev/null +++ b/dDatabase/Tables/CDMotionFXTable.cpp @@ -0,0 +1,51 @@ +#include "CDMotionFXTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.233215 +//DO NOT EDIT THIS FILE MANUALLY! + +CDMotionFXTable::CDMotionFXTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MotionFX"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MotionFX"); + while (!tableData.eof()) { + CDMotionFX entry; + entry.id = tableData.getIntField(0, int{}); + entry.typeID = tableData.getIntField(1, int{}); + entry.slamVelocity = tableData.getFloatField(2, float{}); + entry.addVelocity = tableData.getFloatField(3, float{}); + entry.duration = tableData.getFloatField(4, float{}); + entry.destGroupName = tableData.getStringField(5, std::string{}.c_str()); + entry.startScale = tableData.getFloatField(6, float{}); + entry.endScale = tableData.getFloatField(7, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDMotionFXTable::~CDMotionFXTable() { +} + +std::string CDMotionFXTable::GetName(void) const { + return "MotionFX"; +} + +std::vector CDMotionFXTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDMotionFXTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDMotionFXTable.h b/dDatabase/Tables/CDMotionFXTable.h new file mode 100644 index 0000000..a5ea567 --- /dev/null +++ b/dDatabase/Tables/CDMotionFXTable.h @@ -0,0 +1,28 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.232207 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDMotionFX { + int id; + int typeID; + float slamVelocity; + float addVelocity; + float duration; + std::string destGroupName; + float startScale; + float endScale; +}; + +class CDMotionFXTable : public CDTable { +private: + std::vector m_entries; +public: + CDMotionFXTable(); + ~CDMotionFXTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDMovementAIComponentTable.cpp b/dDatabase/Tables/CDMovementAIComponentTable.cpp deleted file mode 100644 index d4fe488..0000000 --- a/dDatabase/Tables/CDMovementAIComponentTable.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "CDMovementAIComponentTable.h" - -//! Constructor -CDMovementAIComponentTable::CDMovementAIComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM MovementAIComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM MovementAIComponent"); - while (!tableData.eof()) { - CDMovementAIComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.MovementType = tableData.getStringField(1, ""); - entry.WanderChance = tableData.getFloatField(2, -1.0f); - entry.WanderDelayMin = tableData.getFloatField(3, -1.0f); - entry.WanderDelayMax = tableData.getFloatField(4, -1.0f); - entry.WanderSpeed = tableData.getFloatField(5, -1.0f); - entry.WanderRadius = tableData.getFloatField(6, -1.0f); - entry.attachedPath = tableData.getStringField(7, ""); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDMovementAIComponentTable::~CDMovementAIComponentTable(void) { } - -//! Returns the table's name -std::string CDMovementAIComponentTable::GetName(void) const { - return "MovementAIComponent"; -} - -//! Queries the table with a custom "where" clause -std::vector CDMovementAIComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -//! Gets all the entries in the table -std::vector CDMovementAIComponentTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDMovementAIComponentTable.h b/dDatabase/Tables/CDMovementAIComponentTable.h deleted file mode 100644 index 0064a98..0000000 --- a/dDatabase/Tables/CDMovementAIComponentTable.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDMovementAIComponentTable.hpp - \brief Contains data for the MovementAIComponent table - */ - - //! MovementAIComponent Struct -struct CDMovementAIComponent { - unsigned int id; - std::string MovementType; - float WanderChance; - float WanderDelayMin; - float WanderDelayMax; - float WanderSpeed; - float WanderRadius; - std::string attachedPath; -}; - -//! MovementAIComponent table -class CDMovementAIComponentTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDMovementAIComponentTable(void); - - //! Destructor - ~CDMovementAIComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; - diff --git a/dDatabase/Tables/CDNPCCreateDataTable.cpp b/dDatabase/Tables/CDNPCCreateDataTable.cpp new file mode 100644 index 0000000..3684a88 --- /dev/null +++ b/dDatabase/Tables/CDNPCCreateDataTable.cpp @@ -0,0 +1,54 @@ +#include "CDNPCCreateDataTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.238191 +//DO NOT EDIT THIS FILE MANUALLY! + +CDNPCCreateDataTable::CDNPCCreateDataTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM NPCCreateData"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM NPCCreateData"); + while (!tableData.eof()) { + CDNPCCreateData entry; + entry.npcCreateID = tableData.getIntField(0, int{}); + entry.NPCtype = tableData.getStringField(1, std::string{}.c_str()); + entry.Subtype = tableData.getStringField(2, std::string{}.c_str()); + entry.SubSubType = tableData.getStringField(3, std::string{}.c_str()); + entry.animationGroupType = tableData.getStringField(4, std::string{}.c_str()); + entry.RenderAsset = tableData.getStringField(5, std::string{}.c_str()); + entry.ScriptReference = tableData.getIntField(6, int{}); + entry.DestructableReference = tableData.getIntField(7, int{}); + entry.PhysicsReference = tableData.getIntField(8, int{}); + entry.PhysicsTypeRef = tableData.getIntField(9, int{}); + entry.VendorReference = tableData.getIntField(10, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDNPCCreateDataTable::~CDNPCCreateDataTable() { +} + +std::string CDNPCCreateDataTable::GetName(void) const { + return "NPCCreateData"; +} + +std::vector CDNPCCreateDataTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDNPCCreateDataTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDNPCCreateDataTable.h b/dDatabase/Tables/CDNPCCreateDataTable.h new file mode 100644 index 0000000..237123c --- /dev/null +++ b/dDatabase/Tables/CDNPCCreateDataTable.h @@ -0,0 +1,31 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.236434 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDNPCCreateData { + int npcCreateID; + std::string NPCtype; + std::string Subtype; + std::string SubSubType; + std::string animationGroupType; + std::string RenderAsset; + int ScriptReference; + int DestructableReference; + int PhysicsReference; + int PhysicsTypeRef; + int VendorReference; +}; + +class CDNPCCreateDataTable : public CDTable { +private: + std::vector m_entries; +public: + CDNPCCreateDataTable(); + ~CDNPCCreateDataTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDNpcIconsTable.cpp b/dDatabase/Tables/CDNpcIconsTable.cpp new file mode 100644 index 0000000..71ba0b3 --- /dev/null +++ b/dDatabase/Tables/CDNpcIconsTable.cpp @@ -0,0 +1,51 @@ +#include "CDNpcIconsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.243177 +//DO NOT EDIT THIS FILE MANUALLY! + +CDNpcIconsTable::CDNpcIconsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM NpcIcons"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM NpcIcons"); + while (!tableData.eof()) { + CDNpcIcons entry; + entry.id = tableData.getIntField(0, int{}); + entry.color = tableData.getIntField(1, int{}); + entry.offset = tableData.getFloatField(2, float{}); + entry.LOT = tableData.getIntField(3, int{}); + entry.isClickable = tableData.getIntField(4, bool{}); + entry.scale = tableData.getFloatField(5, float{}); + entry.rotateToFace = tableData.getIntField(6, bool{}); + entry.description = tableData.getStringField(7, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDNpcIconsTable::~CDNpcIconsTable() { +} + +std::string CDNpcIconsTable::GetName(void) const { + return "NpcIcons"; +} + +std::vector CDNpcIconsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDNpcIconsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDNpcIconsTable.h b/dDatabase/Tables/CDNpcIconsTable.h new file mode 100644 index 0000000..9858dad --- /dev/null +++ b/dDatabase/Tables/CDNpcIconsTable.h @@ -0,0 +1,28 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.242181 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDNpcIcons { + int id; + int color; + float offset; + int LOT; + bool isClickable; + float scale; + bool rotateToFace; + std::string description; +}; + +class CDNpcIconsTable : public CDTable { +private: + std::vector m_entries; +public: + CDNpcIconsTable(); + ~CDNpcIconsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDObjectSkillsTable.cpp b/dDatabase/Tables/CDObjectSkillsTable.cpp index 4b133df..81b5a1e 100644 --- a/dDatabase/Tables/CDObjectSkillsTable.cpp +++ b/dDatabase/Tables/CDObjectSkillsTable.cpp @@ -1,57 +1,47 @@ #include "CDObjectSkillsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.252158 +//DO NOT EDIT THIS FILE MANUALLY! + +CDObjectSkillsTable::CDObjectSkillsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ObjectSkills"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDObjectSkillsTable::CDObjectSkillsTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ObjectSkills"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ObjectSkills"); - while (!tableData.eof()) { - CDObjectSkills entry; - entry.objectTemplate = tableData.getIntField(0, -1); - entry.skillID = tableData.getIntField(1, -1); - entry.castOnType = tableData.getIntField(2, -1); - entry.AICombatWeight = tableData.getIntField(3, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ObjectSkills"); + while (!tableData.eof()) { + CDObjectSkills entry; + entry.objectTemplate = tableData.getIntField(0, int{}); + entry.skillID = tableData.getIntField(1, int{}); + entry.castOnType = tableData.getIntField(2, int{}); + entry.AICombatWeight = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDObjectSkillsTable::~CDObjectSkillsTable(void) { } +CDObjectSkillsTable::~CDObjectSkillsTable() { +} -//! Returns the table's name std::string CDObjectSkillsTable::GetName(void) const { - return "ObjectSkills"; + return "ObjectSkills"; } -//! Queries the table with a custom "where" clause std::vector CDObjectSkillsTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDObjectSkillsTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDObjectSkillsTable.h b/dDatabase/Tables/CDObjectSkillsTable.h index 986d95d..e5dcd91 100644 --- a/dDatabase/Tables/CDObjectSkillsTable.h +++ b/dDatabase/Tables/CDObjectSkillsTable.h @@ -1,51 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDObjectSkillsTable.hpp - \brief Contains data for the ObjectSkills table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.250159 +//DO NOT EDIT THIS FILE MANUALLY! -//! ObjectSkills Struct struct CDObjectSkills { - unsigned int objectTemplate; //!< The LOT of the item - unsigned int skillID; //!< The Skill ID of the object - unsigned int castOnType; //!< ??? - unsigned int AICombatWeight; //!< ??? + int objectTemplate; + int skillID; + int castOnType; + int AICombatWeight; }; -//! ObjectSkills table class CDObjectSkillsTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDObjectSkillsTable(void); - - //! Destructor - ~CDObjectSkillsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; + CDObjectSkillsTable(); + ~CDObjectSkillsTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDObjectsTable.cpp b/dDatabase/Tables/CDObjectsTable.cpp index 5106f96..099c10b 100644 --- a/dDatabase/Tables/CDObjectsTable.cpp +++ b/dDatabase/Tables/CDObjectsTable.cpp @@ -1,102 +1,53 @@ #include "CDObjectsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.248170 +//DO NOT EDIT THIS FILE MANUALLY! + +CDObjectsTable::CDObjectsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Objects"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDObjectsTable::CDObjectsTable(void) { -#ifdef CDCLIENT_CACHE_ALL - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Objects"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Objects"); - while (!tableData.eof()) { - CDObjects entry; - entry.id = tableData.getIntField(0, -1); - entry.name = tableData.getStringField(1, ""); - entry.placeable = tableData.getIntField(2, -1); - entry.type = tableData.getStringField(3, ""); - entry.description = tableData.getStringField(4, ""); - entry.localize = tableData.getIntField(5, -1); - entry.npcTemplateID = tableData.getIntField(6, -1); - entry.displayName = tableData.getStringField(7, ""); - entry.interactionDistance = tableData.getFloatField(8, -1.0f); - entry.nametag = tableData.getIntField(9, -1); - entry._internalNotes = tableData.getStringField(10, ""); - entry.locStatus = tableData.getIntField(11, -1); - entry.gate_version = tableData.getStringField(12, ""); - entry.HQ_valid = tableData.getIntField(13, -1); - - this->entries.insert(std::make_pair(entry.id, entry)); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Objects"); + while (!tableData.eof()) { + CDObjects entry; + entry.id = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + entry.placeable = tableData.getIntField(2, bool{}); + entry.type = tableData.getStringField(3, std::string{}.c_str()); + entry.description = tableData.getStringField(4, std::string{}.c_str()); + entry.localize = tableData.getIntField(5, bool{}); + entry.npcTemplateID = tableData.getIntField(6, int{}); + entry.displayName = tableData.getStringField(7, std::string{}.c_str()); + entry.interactionDistance = tableData.getFloatField(8, float{}); + entry.nametag = tableData.getIntField(9, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); -#endif - - m_default.id = 0; } -//! Destructor -CDObjectsTable::~CDObjectsTable(void) { } +CDObjectsTable::~CDObjectsTable() { +} -//! Returns the table's name std::string CDObjectsTable::GetName(void) const { - return "Objects"; + return "Objects"; } -const CDObjects & CDObjectsTable::GetByID(unsigned int LOT) { - const auto& it = this->entries.find(LOT); - if (it != this->entries.end()) { - return it->second; - } +std::vector CDObjectsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); -#ifndef CDCLIENT_CACHE_ALL - std::stringstream query; + return data; +} - query << "SELECT * FROM Objects WHERE id = " << std::to_string(LOT); - - auto tableData = CDClientDatabase::ExecuteQuery(query.str()); - if (tableData.eof()) { - this->entries.insert(std::make_pair(LOT, m_default)); - return m_default; - } - - // Now get the data - while (!tableData.eof()) { - CDObjects entry; - entry.id = tableData.getIntField(0, -1); - entry.name = tableData.getStringField(1, ""); - UNUSED(entry.placeable = tableData.getIntField(2, -1)); - entry.type = tableData.getStringField(3, ""); - UNUSED(ntry.description = tableData.getStringField(4, "")); - UNUSED(entry.localize = tableData.getIntField(5, -1)); - UNUSED(entry.npcTemplateID = tableData.getIntField(6, -1)); - UNUSED(entry.displayName = tableData.getStringField(7, "")); - entry.interactionDistance = tableData.getFloatField(8, -1.0f); - UNUSED(entry.nametag = tableData.getIntField(9, -1)); - UNUSED(entry._internalNotes = tableData.getStringField(10, "")); - UNUSED(entry.locStatus = tableData.getIntField(11, -1)); - UNUSED(entry.gate_version = tableData.getStringField(12, "")); - UNUSED(entry.HQ_valid = tableData.getIntField(13, -1)); - - this->entries.insert(std::make_pair(entry.id, entry)); - tableData.nextRow(); - } - - tableData.finalize(); - - const auto& it2 = entries.find(LOT); - if (it2 != entries.end()) { - return it2->second; - } -#endif - - return m_default; -} \ No newline at end of file +std::vector CDObjectsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDObjectsTable.h b/dDatabase/Tables/CDObjectsTable.h index c6dbc66..c8b8d3c 100644 --- a/dDatabase/Tables/CDObjectsTable.h +++ b/dDatabase/Tables/CDObjectsTable.h @@ -1,54 +1,30 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDObjectsTable.hpp - \brief Contains data for the Objects table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.246169 +//DO NOT EDIT THIS FILE MANUALLY! -//! RebuildComponent Struct struct CDObjects { - unsigned int id; //!< The LOT of the object - std::string name; //!< The internal name of the object - UNUSED(unsigned int placeable); //!< Whether or not the object is placable - std::string type; //!< The object type - UNUSED(std::string description); //!< An internal description of the object - UNUSED(unsigned int localize); //!< Whether or not the object should localize - UNUSED(unsigned int npcTemplateID); //!< Something related to NPCs... - UNUSED(std::string displayName); //!< The display name of the object - float interactionDistance; //!< The interaction distance of the object - UNUSED(unsigned int nametag); //!< ??? - UNUSED(std::string _internalNotes); //!< Some internal notes (rarely used) - UNUSED(unsigned int locStatus); //!< ??? - UNUSED(std::string gate_version); //!< The gate version for the object - UNUSED(unsigned int HQ_valid); //!< Probably used for the Nexus HQ database on LEGOUniverse.com + int id; + std::string name; + bool placeable; + std::string type; + std::string description; + bool localize; + int npcTemplateID; + std::string displayName; + float interactionDistance; + bool nametag; }; -//! ObjectSkills table class CDObjectsTable : public CDTable { private: - //std::vector entries; - std::map entries; - CDObjects m_default; - + std::vector m_entries; public: - - //! Constructor - CDObjectsTable(void); - - //! Destructor - ~CDObjectsTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Gets an entry by ID - const CDObjects& GetByID(unsigned int LOT); + CDObjectsTable(); + ~CDObjectsTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDPackageComponentTable.cpp b/dDatabase/Tables/CDPackageComponentTable.cpp index 23af5e3..9d236d5 100644 --- a/dDatabase/Tables/CDPackageComponentTable.cpp +++ b/dDatabase/Tables/CDPackageComponentTable.cpp @@ -1,56 +1,45 @@ #include "CDPackageComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.257140 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDPackageComponentTable::CDPackageComponentTable(void) { - - // First, get the size of the table +CDPackageComponentTable::CDPackageComponentTable() { unsigned int size = 0; auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PackageComponent"); - while (!tableSize.eof()) { + while (!tableSize.eof()) { size = tableSize.getIntField(0, 0); - tableSize.nextRow(); } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - // Now get the data + tableSize.finalize(); + this->m_entries.reserve(size); + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PackageComponent"); while (!tableData.eof()) { CDPackageComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.LootMatrixIndex = tableData.getIntField(1, -1); - entry.packageType = tableData.getIntField(2, -1); - - this->entries.push_back(entry); + entry.id = tableData.getIntField(0, int{}); + entry.LootMatrixIndex = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); tableData.nextRow(); } tableData.finalize(); } -//! Destructor -CDPackageComponentTable::~CDPackageComponentTable(void) { } +CDPackageComponentTable::~CDPackageComponentTable() { +} -//! Returns the table's name std::string CDPackageComponentTable::GetName(void) const { return "PackageComponent"; } -//! Queries the table with a custom "where" clause std::vector CDPackageComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) + std::vector data = cpplinq::from(this->m_entries) >> cpplinq::where(predicate) >> cpplinq::to_vector(); return data; } -//! Gets all the entries in the table std::vector CDPackageComponentTable::GetEntries(void) const { - return this->entries; -} \ No newline at end of file + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPackageComponentTable.h b/dDatabase/Tables/CDPackageComponentTable.h index 763acf8..b31ad04 100644 --- a/dDatabase/Tables/CDPackageComponentTable.h +++ b/dDatabase/Tables/CDPackageComponentTable.h @@ -1,50 +1,22 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDPackageComponentTable.hpp - \brief Contains data for the PackageComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.256377 +//DO NOT EDIT THIS FILE MANUALLY! - //! PackageComponent Entry Struct struct CDPackageComponent { - unsigned int id; - unsigned int LootMatrixIndex; - unsigned int packageType; + int id; + int LootMatrixIndex; }; - -//! PackageComponent table class CDPackageComponentTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDPackageComponentTable(void); - - //! Destructor - ~CDPackageComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ + CDPackageComponentTable(); + ~CDPackageComponentTable(); std::string GetName(void) const override; - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ +std::vector Query(std::function predicate); std::vector GetEntries(void) const; - }; diff --git a/dDatabase/Tables/CDPetAbilitiesTable.cpp b/dDatabase/Tables/CDPetAbilitiesTable.cpp new file mode 100644 index 0000000..5c40f1d --- /dev/null +++ b/dDatabase/Tables/CDPetAbilitiesTable.cpp @@ -0,0 +1,47 @@ +#include "CDPetAbilitiesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.262473 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPetAbilitiesTable::CDPetAbilitiesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PetAbilities"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PetAbilities"); + while (!tableData.eof()) { + CDPetAbilities entry; + entry.id = tableData.getIntField(0, int{}); + entry.AbilityName = tableData.getStringField(1, std::string{}.c_str()); + entry.ImaginationCost = tableData.getIntField(2, int{}); + entry.DisplayName = tableData.getStringField(3, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPetAbilitiesTable::~CDPetAbilitiesTable() { +} + +std::string CDPetAbilitiesTable::GetName(void) const { + return "PetAbilities"; +} + +std::vector CDPetAbilitiesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPetAbilitiesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPetAbilitiesTable.h b/dDatabase/Tables/CDPetAbilitiesTable.h new file mode 100644 index 0000000..f418e7d --- /dev/null +++ b/dDatabase/Tables/CDPetAbilitiesTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.261132 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPetAbilities { + int id; + std::string AbilityName; + int ImaginationCost; + std::string DisplayName; +}; + +class CDPetAbilitiesTable : public CDTable { +private: + std::vector m_entries; +public: + CDPetAbilitiesTable(); + ~CDPetAbilitiesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPetComponentTable.cpp b/dDatabase/Tables/CDPetComponentTable.cpp new file mode 100644 index 0000000..25b6f1b --- /dev/null +++ b/dDatabase/Tables/CDPetComponentTable.cpp @@ -0,0 +1,60 @@ +#include "CDPetComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.267114 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPetComponentTable::CDPetComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PetComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PetComponent"); + while (!tableData.eof()) { + CDPetComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.minTameUpdateTime = tableData.getFloatField(2, float{}); + entry.maxTameUpdateTime = tableData.getFloatField(3, float{}); + entry.percentTameChance = tableData.getFloatField(4, float{}); + entry.tamability = tableData.getFloatField(5, float{}); + entry.elementType = tableData.getIntField(6, int{}); + entry.walkSpeed = tableData.getFloatField(7, float{}); + entry.runSpeed = tableData.getFloatField(8, float{}); + entry.sprintSpeed = tableData.getFloatField(9, float{}); + entry.idleTimeMin = tableData.getFloatField(10, float{}); + entry.idleTimeMax = tableData.getFloatField(11, float{}); + entry.eggLotId = tableData.getIntField(12, int{}); + entry.petForm = tableData.getIntField(13, int{}); + entry.imaginationDrainRate = tableData.getFloatField(14, float{}); + entry.AudioMetaEventSet = tableData.getStringField(15, std::string{}.c_str()); + entry.playerFlag = tableData.getIntField(16, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPetComponentTable::~CDPetComponentTable() { +} + +std::string CDPetComponentTable::GetName(void) const { + return "PetComponent"; +} + +std::vector CDPetComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPetComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPetComponentTable.h b/dDatabase/Tables/CDPetComponentTable.h new file mode 100644 index 0000000..2999f5f --- /dev/null +++ b/dDatabase/Tables/CDPetComponentTable.h @@ -0,0 +1,37 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.265119 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPetComponent { + int id; + std::string description; + float minTameUpdateTime; + float maxTameUpdateTime; + float percentTameChance; + float tamability; + int elementType; + float walkSpeed; + float runSpeed; + float sprintSpeed; + float idleTimeMin; + float idleTimeMax; + int eggLotId; + int petForm; + float imaginationDrainRate; + std::string AudioMetaEventSet; + int playerFlag; +}; + +class CDPetComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDPetComponentTable(); + ~CDPetComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPetNestComponentTable.cpp b/dDatabase/Tables/CDPetNestComponentTable.cpp new file mode 100644 index 0000000..1393e72 --- /dev/null +++ b/dDatabase/Tables/CDPetNestComponentTable.cpp @@ -0,0 +1,45 @@ +#include "CDPetNestComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.271103 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPetNestComponentTable::CDPetNestComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PetNestComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PetNestComponent"); + while (!tableData.eof()) { + CDPetNestComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.ElementalType = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPetNestComponentTable::~CDPetNestComponentTable() { +} + +std::string CDPetNestComponentTable::GetName(void) const { + return "PetNestComponent"; +} + +std::vector CDPetNestComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPetNestComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPetNestComponentTable.h b/dDatabase/Tables/CDPetNestComponentTable.h new file mode 100644 index 0000000..4d4e41e --- /dev/null +++ b/dDatabase/Tables/CDPetNestComponentTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.269108 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPetNestComponent { + int id; + int ElementalType; +}; + +class CDPetNestComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDPetNestComponentTable(); + ~CDPetNestComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPhysicsComponentTable.cpp b/dDatabase/Tables/CDPhysicsComponentTable.cpp index b4b836a..ef5d897 100644 --- a/dDatabase/Tables/CDPhysicsComponentTable.cpp +++ b/dDatabase/Tables/CDPhysicsComponentTable.cpp @@ -1,49 +1,58 @@ #include "CDPhysicsComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.276090 +//DO NOT EDIT THIS FILE MANUALLY! -CDPhysicsComponentTable::CDPhysicsComponentTable(void) { - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PhysicsComponent"); - while (!tableData.eof()) { - CDPhysicsComponent* entry = new CDPhysicsComponent(); - entry->id = tableData.getIntField(0, -1); - entry->bStatic = tableData.getIntField(1, -1) != 0; - entry->physicsAsset = tableData.getStringField(2, ""); - UNUSED(entry->jump = tableData.getIntField(3, -1) != 0); - UNUSED(entry->doublejump = tableData.getIntField(4, -1) != 0); - entry->speed = tableData.getFloatField(5, -1); - UNUSED(entry->rotSpeed = tableData.getFloatField(6, -1)); - entry->playerHeight = tableData.getFloatField(7); - entry->playerRadius = tableData.getFloatField(8); - entry->pcShapeType = tableData.getIntField(9); - entry->collisionGroup = tableData.getIntField(10); - UNUSED(entry->airSpeed = tableData.getFloatField(11)); - UNUSED(entry->boundaryAsset = tableData.getStringField(12)); - UNUSED(entry->jumpAirSpeed = tableData.getFloatField(13)); - UNUSED(entry->friction = tableData.getFloatField(14)); - UNUSED(entry->gravityVolumeAsset = tableData.getStringField(15)); +CDPhysicsComponentTable::CDPhysicsComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PhysicsComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } - m_entries.insert(std::make_pair(entry->id, entry)); - tableData.nextRow(); - } + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PhysicsComponent"); + while (!tableData.eof()) { + CDPhysicsComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.isStatic = tableData.getFloatField(1, float{}); + entry.physics_asset = tableData.getStringField(2, std::string{}.c_str()); + entry.jump = tableData.getFloatField(3, float{}); + entry.doublejump = tableData.getFloatField(4, float{}); + entry.speed = tableData.getFloatField(5, float{}); + entry.rotSpeed = tableData.getFloatField(6, float{}); + entry.playerHeight = tableData.getFloatField(7, float{}); + entry.playerRadius = tableData.getFloatField(8, float{}); + entry.pcShapeType = tableData.getIntField(9, int{}); + entry.collisionGroup = tableData.getIntField(10, int{}); + entry.airSpeed = tableData.getFloatField(11, float{}); + entry.boundaryAsset = tableData.getStringField(12, std::string{}.c_str()); + entry.jumpAirSpeed = tableData.getFloatField(13, float{}); + entry.friction = tableData.getFloatField(14, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -CDPhysicsComponentTable::~CDPhysicsComponentTable(void) { - for (auto e : m_entries) { - if (e.second) delete e.second; - } - - m_entries.clear(); +CDPhysicsComponentTable::~CDPhysicsComponentTable() { } std::string CDPhysicsComponentTable::GetName(void) const { - return "PhysicsComponent"; + return "PhysicsComponent"; } -CDPhysicsComponent* CDPhysicsComponentTable::GetByID(unsigned int componentID) { - for (auto e : m_entries) { - if (e.first == componentID) return e.second; - } - - return nullptr; +std::vector CDPhysicsComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPhysicsComponentTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDPhysicsComponentTable.h b/dDatabase/Tables/CDPhysicsComponentTable.h index aa19757..e984798 100644 --- a/dDatabase/Tables/CDPhysicsComponentTable.h +++ b/dDatabase/Tables/CDPhysicsComponentTable.h @@ -1,34 +1,35 @@ #pragma once #include "CDTable.h" -#include + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.274095 +//DO NOT EDIT THIS FILE MANUALLY! struct CDPhysicsComponent { int id; - bool bStatic; - std::string physicsAsset; - UNUSED(bool jump); - UNUSED(bool doublejump); + float isStatic; + std::string physics_asset; + float jump; + float doublejump; float speed; - UNUSED(float rotSpeed); + float rotSpeed; float playerHeight; float playerRadius; int pcShapeType; int collisionGroup; - UNUSED(float airSpeed); - UNUSED(std::string boundaryAsset); - UNUSED(float jumpAirSpeed); - UNUSED(float friction); - UNUSED(std::string gravityVolumeAsset); + float airSpeed; + std::string boundaryAsset; + float jumpAirSpeed; + float friction; }; class CDPhysicsComponentTable : public CDTable { -public: - CDPhysicsComponentTable(void); - ~CDPhysicsComponentTable(void); - - std::string GetName(void) const override; - CDPhysicsComponent* GetByID(unsigned int componentID); - private: - std::map m_entries; -}; \ No newline at end of file + std::vector m_entries; +public: + CDPhysicsComponentTable(); + ~CDPhysicsComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPlayerFlagsTable.cpp b/dDatabase/Tables/CDPlayerFlagsTable.cpp new file mode 100644 index 0000000..158df0b --- /dev/null +++ b/dDatabase/Tables/CDPlayerFlagsTable.cpp @@ -0,0 +1,45 @@ +#include "CDPlayerFlagsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.281077 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPlayerFlagsTable::CDPlayerFlagsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PlayerFlags"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PlayerFlags"); + while (!tableData.eof()) { + CDPlayerFlags entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPlayerFlagsTable::~CDPlayerFlagsTable() { +} + +std::string CDPlayerFlagsTable::GetName(void) const { + return "PlayerFlags"; +} + +std::vector CDPlayerFlagsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPlayerFlagsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPlayerFlagsTable.h b/dDatabase/Tables/CDPlayerFlagsTable.h new file mode 100644 index 0000000..2787d3a --- /dev/null +++ b/dDatabase/Tables/CDPlayerFlagsTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.279087 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPlayerFlags { + int id; + std::string description; +}; + +class CDPlayerFlagsTable : public CDTable { +private: + std::vector m_entries; +public: + CDPlayerFlagsTable(); + ~CDPlayerFlagsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPreconditionTypesTable.cpp b/dDatabase/Tables/CDPreconditionTypesTable.cpp new file mode 100644 index 0000000..ff9b446 --- /dev/null +++ b/dDatabase/Tables/CDPreconditionTypesTable.cpp @@ -0,0 +1,45 @@ +#include "CDPreconditionTypesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.289069 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPreconditionTypesTable::CDPreconditionTypesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PreconditionTypes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PreconditionTypes"); + while (!tableData.eof()) { + CDPreconditionTypes entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPreconditionTypesTable::~CDPreconditionTypesTable() { +} + +std::string CDPreconditionTypesTable::GetName(void) const { + return "PreconditionTypes"; +} + +std::vector CDPreconditionTypesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPreconditionTypesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPreconditionTypesTable.h b/dDatabase/Tables/CDPreconditionTypesTable.h new file mode 100644 index 0000000..ed62d04 --- /dev/null +++ b/dDatabase/Tables/CDPreconditionTypesTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.288057 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPreconditionTypes { + int id; + std::string description; +}; + +class CDPreconditionTypesTable : public CDTable { +private: + std::vector m_entries; +public: + CDPreconditionTypesTable(); + ~CDPreconditionTypesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPreconditionsTable.cpp b/dDatabase/Tables/CDPreconditionsTable.cpp new file mode 100644 index 0000000..e039495 --- /dev/null +++ b/dDatabase/Tables/CDPreconditionsTable.cpp @@ -0,0 +1,50 @@ +#include "CDPreconditionsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.286063 +//DO NOT EDIT THIS FILE MANUALLY! + +CDPreconditionsTable::CDPreconditionsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM Preconditions"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Preconditions"); + while (!tableData.eof()) { + CDPreconditions entry; + entry.id = tableData.getIntField(0, int{}); + entry.type = tableData.getIntField(1, int{}); + entry.description = tableData.getStringField(2, std::string{}.c_str()); + entry.targetLOT = tableData.getStringField(3, std::string{}.c_str()); + entry.targetGroup = tableData.getStringField(4, std::string{}.c_str()); + entry.targetCount = tableData.getIntField(5, int{}); + entry.FailureReason = tableData.getStringField(6, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDPreconditionsTable::~CDPreconditionsTable() { +} + +std::string CDPreconditionsTable::GetName(void) const { + return "Preconditions"; +} + +std::vector CDPreconditionsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPreconditionsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDPreconditionsTable.h b/dDatabase/Tables/CDPreconditionsTable.h new file mode 100644 index 0000000..3e33c27 --- /dev/null +++ b/dDatabase/Tables/CDPreconditionsTable.h @@ -0,0 +1,27 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.285066 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDPreconditions { + int id; + int type; + std::string description; + std::string targetLOT; + std::string targetGroup; + int targetCount; + std::string FailureReason; +}; + +class CDPreconditionsTable : public CDTable { +private: + std::vector m_entries; +public: + CDPreconditionsTable(); + ~CDPreconditionsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDPropertyEntranceComponentTable.cpp b/dDatabase/Tables/CDPropertyEntranceComponentTable.cpp deleted file mode 100644 index 500ef65..0000000 --- a/dDatabase/Tables/CDPropertyEntranceComponentTable.cpp +++ /dev/null @@ -1,48 +0,0 @@ - -#include "CDPropertyEntranceComponentTable.h" - -CDPropertyEntranceComponentTable::CDPropertyEntranceComponentTable() { - - // First, get the size of the table - size_t size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PropertyEntranceComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - tableSize.nextRow(); - } - - tableSize.finalize(); - - this->entries.reserve(size); - - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyEntranceComponent;"); - while (!tableData.eof()) { - auto entry = CDPropertyEntranceComponent { - static_cast(tableData.getIntField(0, -1)), - static_cast(tableData.getIntField(1, -1)), - tableData.getStringField(2, ""), - static_cast(tableData.getIntField(3, false)), - tableData.getStringField(4, "") - }; - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -CDPropertyEntranceComponentTable::~CDPropertyEntranceComponentTable(void) = default; - -std::string CDPropertyEntranceComponentTable::GetName() const { - return "PropertyEntranceComponent"; -} - -CDPropertyEntranceComponent CDPropertyEntranceComponentTable::GetByID(uint32_t id) { - for (const auto& entry : entries) { - if (entry.id == id) - return entry; - } - - return defaultEntry; -} diff --git a/dDatabase/Tables/CDPropertyEntranceComponentTable.h b/dDatabase/Tables/CDPropertyEntranceComponentTable.h deleted file mode 100644 index 8cecd94..0000000 --- a/dDatabase/Tables/CDPropertyEntranceComponentTable.h +++ /dev/null @@ -1,41 +0,0 @@ -#pragma once -#include "CDTable.h" - -struct CDPropertyEntranceComponent { - uint32_t id; - uint32_t mapID; - std::string propertyName; - bool isOnProperty; - std::string groupType; -}; - -class CDPropertyEntranceComponentTable : public CDTable { -public: - //! Constructor - CDPropertyEntranceComponentTable(); - - //! Destructor - ~CDPropertyEntranceComponentTable(); - - //! Returns the table's name - /*! - \return The table name - */ - [[nodiscard]] std::string GetName() const override; - - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - CDPropertyEntranceComponent GetByID(uint32_t id); - - //! Gets all the entries in the table - /*! - \return The entries - */ - [[nodiscard]] std::vector GetEntries() const { return entries; } -private: - std::vector entries {}; - CDPropertyEntranceComponent defaultEntry {}; -}; diff --git a/dDatabase/Tables/CDPropertyTemplateTable.cpp b/dDatabase/Tables/CDPropertyTemplateTable.cpp index 11ba937..ed93ace 100644 --- a/dDatabase/Tables/CDPropertyTemplateTable.cpp +++ b/dDatabase/Tables/CDPropertyTemplateTable.cpp @@ -1,46 +1,62 @@ #include "CDPropertyTemplateTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.295313 +//DO NOT EDIT THIS FILE MANUALLY! CDPropertyTemplateTable::CDPropertyTemplateTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PropertyTemplate"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } - // First, get the size of the table - size_t size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM PropertyTemplate;"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - tableSize.nextRow(); - } - tableSize.finalize(); - - this->entries.reserve(size); + this->m_entries.reserve(size); - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyTemplate;"); - while (!tableData.eof()) { - auto entry = CDPropertyTemplate { - static_cast(tableData.getIntField(0, -1)), - static_cast(tableData.getIntField(1, -1)), - static_cast(tableData.getIntField(2, -1)), - tableData.getStringField(3, "") - }; - - this->entries.push_back(entry); - tableData.nextRow(); - } + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM PropertyTemplate"); + while (!tableData.eof()) { + CDPropertyTemplate entry; + entry.id = tableData.getInt64Field(0, uint64_t{}); + entry.mapID = tableData.getInt64Field(1, uint64_t{}); + entry.vendorMapID = tableData.getInt64Field(2, uint64_t{}); + entry.spawnName = tableData.getStringField(3, std::string{}.c_str()); + entry.type = tableData.getIntField(4, int{}); + entry.sizecode = tableData.getIntField(5, int{}); + entry.minimumPrice = tableData.getInt64Field(6, uint64_t{}); + entry.rentDuration = tableData.getInt64Field(7, uint64_t{}); + entry.path = tableData.getStringField(8, std::string{}.c_str()); + entry.name = tableData.getStringField(9, std::string{}.c_str()); + entry.description = tableData.getStringField(10, std::string{}.c_str()); + entry.cloneLimit = tableData.getIntField(11, int{}); + entry.reputationPerVote = tableData.getFloatField(12, float{}); + entry.durationType = tableData.getIntField(13, int{}); + entry.achievementRequired = tableData.getIntField(14, int{}); + entry.zoneX = tableData.getFloatField(15, float{}); + entry.zoneY = tableData.getFloatField(16, float{}); + entry.zoneZ = tableData.getFloatField(17, float{}); + entry.maxBuildHeight = tableData.getFloatField(18, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -CDPropertyTemplateTable::~CDPropertyTemplateTable() = default; - -std::string CDPropertyTemplateTable::GetName() const { - return "PropertyTemplate"; +CDPropertyTemplateTable::~CDPropertyTemplateTable() { } -CDPropertyTemplate CDPropertyTemplateTable::GetByMapID(uint32_t mapID) { - for (const auto& entry : entries) { - if (entry.mapID == mapID) - return entry; - } - - return defaultEntry; +std::string CDPropertyTemplateTable::GetName(void) const { + return "PropertyTemplate"; +} + +std::vector CDPropertyTemplateTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDPropertyTemplateTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDPropertyTemplateTable.h b/dDatabase/Tables/CDPropertyTemplateTable.h index 24e6a73..f8e4be4 100644 --- a/dDatabase/Tables/CDPropertyTemplateTable.h +++ b/dDatabase/Tables/CDPropertyTemplateTable.h @@ -1,21 +1,39 @@ #pragma once #include "CDTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.292047 +//DO NOT EDIT THIS FILE MANUALLY! + struct CDPropertyTemplate { - uint32_t id; - uint32_t mapID; - uint32_t vendorMapID; - std::string spawnName; + uint64_t id; + uint64_t mapID; + uint64_t vendorMapID; + std::string spawnName; + int type; + int sizecode; + uint64_t minimumPrice; + uint64_t rentDuration; + std::string path; + std::string name; + std::string description; + int cloneLimit; + float reputationPerVote; + int durationType; + int achievementRequired; + float zoneX; + float zoneY; + float zoneZ; + float maxBuildHeight; }; class CDPropertyTemplateTable : public CDTable { -public: - CDPropertyTemplateTable(); - ~CDPropertyTemplateTable(); - - [[nodiscard]] std::string GetName() const override; - CDPropertyTemplate GetByMapID(uint32_t mapID); private: - std::vector entries {}; - CDPropertyTemplate defaultEntry {}; -}; \ No newline at end of file + std::vector m_entries; +public: + CDPropertyTemplateTable(); + ~CDPropertyTemplateTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDProximityMonitorComponentTable.cpp b/dDatabase/Tables/CDProximityMonitorComponentTable.cpp deleted file mode 100644 index d4195f0..0000000 --- a/dDatabase/Tables/CDProximityMonitorComponentTable.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "CDProximityMonitorComponentTable.h" - -//! Constructor -CDProximityMonitorComponentTable::CDProximityMonitorComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ProximityMonitorComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ProximityMonitorComponent"); - while (!tableData.eof()) { - CDProximityMonitorComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.Proximities = tableData.getStringField(1, ""); - entry.LoadOnClient = tableData.getIntField(2, -1); - entry.LoadOnServer = tableData.getIntField(3, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -//! Destructor -CDProximityMonitorComponentTable::~CDProximityMonitorComponentTable(void) { } - -//! Returns the table's name -std::string CDProximityMonitorComponentTable::GetName(void) const { - return "ProximityMonitorComponent"; -} - -//! Queries the table with a custom "where" clause -std::vector CDProximityMonitorComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; -} - -//! Gets all the entries in the table -std::vector CDProximityMonitorComponentTable::GetEntries(void) const { - return this->entries; -} diff --git a/dDatabase/Tables/CDProximityMonitorComponentTable.h b/dDatabase/Tables/CDProximityMonitorComponentTable.h deleted file mode 100644 index 007bb91..0000000 --- a/dDatabase/Tables/CDProximityMonitorComponentTable.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -// Custom Classes -#include "CDTable.h" - -/*! - \file CDProximityMonitorComponentTable.hpp - \brief Contains data for the ProximityMonitorComponent table - */ - - //! ProximityMonitorComponent Entry Struct -struct CDProximityMonitorComponent { - unsigned int id; - std::string Proximities; - bool LoadOnClient; - bool LoadOnServer; -}; - - -//! ProximityMonitorComponent table -class CDProximityMonitorComponentTable : public CDTable { -private: - std::vector entries; - -public: - - //! Constructor - CDProximityMonitorComponentTable(void); - - //! Destructor - ~CDProximityMonitorComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; diff --git a/dDatabase/Tables/CDRacingModuleComponentTable.cpp b/dDatabase/Tables/CDRacingModuleComponentTable.cpp new file mode 100644 index 0000000..68ab39a --- /dev/null +++ b/dDatabase/Tables/CDRacingModuleComponentTable.cpp @@ -0,0 +1,49 @@ +#include "CDRacingModuleComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.328966 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRacingModuleComponentTable::CDRacingModuleComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RacingModuleComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RacingModuleComponent"); + while (!tableData.eof()) { + CDRacingModuleComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.topSpeed = tableData.getFloatField(1, float{}); + entry.acceleration = tableData.getFloatField(2, float{}); + entry.handling = tableData.getFloatField(3, float{}); + entry.stability = tableData.getFloatField(4, float{}); + entry.imagination = tableData.getFloatField(5, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRacingModuleComponentTable::~CDRacingModuleComponentTable() { +} + +std::string CDRacingModuleComponentTable::GetName(void) const { + return "RacingModuleComponent"; +} + +std::vector CDRacingModuleComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRacingModuleComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRacingModuleComponentTable.h b/dDatabase/Tables/CDRacingModuleComponentTable.h new file mode 100644 index 0000000..85b9c5d --- /dev/null +++ b/dDatabase/Tables/CDRacingModuleComponentTable.h @@ -0,0 +1,26 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.323961 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRacingModuleComponent { + int id; + float topSpeed; + float acceleration; + float handling; + float stability; + float imagination; +}; + +class CDRacingModuleComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDRacingModuleComponentTable(); + ~CDRacingModuleComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRailActivatorComponent.cpp b/dDatabase/Tables/CDRailActivatorComponent.cpp deleted file mode 100644 index e3a2f8b..0000000 --- a/dDatabase/Tables/CDRailActivatorComponent.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include "CDRailActivatorComponent.h" -#include "GeneralUtils.h" - -CDRailActivatorComponentTable::CDRailActivatorComponentTable() { - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RailActivatorComponent;"); - while (!tableData.eof()) { - CDRailActivatorComponent entry; - - entry.id = tableData.getIntField(0); - - std::string startAnimation(tableData.getStringField(1, "")); - entry.startAnimation = GeneralUtils::ASCIIToUTF16(startAnimation); - - std::string loopAnimation(tableData.getStringField(2, "")); - entry.loopAnimation = GeneralUtils::ASCIIToUTF16(loopAnimation); - - std::string stopAnimation(tableData.getStringField(3, "")); - entry.stopAnimation = GeneralUtils::ASCIIToUTF16(stopAnimation); - - std::string startSound(tableData.getStringField(4, "")); - entry.startSound = GeneralUtils::ASCIIToUTF16(startSound); - - std::string loopSound(tableData.getStringField(5, "")); - entry.loopSound = GeneralUtils::ASCIIToUTF16(loopSound); - - std::string stopSound(tableData.getStringField(6, "")); - entry.stopSound = GeneralUtils::ASCIIToUTF16(stopSound); - - std::string loopEffectString(tableData.getStringField(7, "")); - entry.loopEffectID = EffectPairFromString(loopEffectString); - - entry.preconditions = tableData.getStringField(8, "-1"); - - entry.playerCollision = tableData.getIntField(9, 0); - - entry.cameraLocked = tableData.getIntField(10, 0); - - std::string startEffectString(tableData.getStringField(11, "")); - entry.startEffectID = EffectPairFromString(startEffectString); - - std::string stopEffectString(tableData.getStringField(12, "")); - entry.stopEffectID = EffectPairFromString(stopEffectString); - - entry.damageImmune = tableData.getIntField(13, 0); - - entry.noAggro = tableData.getIntField(14, 0); - - entry.showNameBillboard = tableData.getIntField(15, 0); - - m_Entries.push_back(entry); - tableData.nextRow(); - } - - tableData.finalize(); -} - -CDRailActivatorComponentTable::~CDRailActivatorComponentTable() = default; - -std::string CDRailActivatorComponentTable::GetName() const { - return "RailActivatorComponent"; -} - -CDRailActivatorComponent CDRailActivatorComponentTable::GetEntryByID(int32_t id) const { - for (const auto& entry : m_Entries) { - if (entry.id == id) - return entry; - } - - return {}; -} - -std::vector CDRailActivatorComponentTable::GetEntries() const { - return m_Entries; -} - -std::pair CDRailActivatorComponentTable::EffectPairFromString(std::string &str) { - const auto split = GeneralUtils::SplitString(str, ':'); - if (split.size() == 2) { - return { std::stoi(split.at(0)), GeneralUtils::ASCIIToUTF16(split.at(1)) }; - } - - return {}; -} diff --git a/dDatabase/Tables/CDRailActivatorComponent.h b/dDatabase/Tables/CDRailActivatorComponent.h deleted file mode 100644 index 4f06ff5..0000000 --- a/dDatabase/Tables/CDRailActivatorComponent.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once -#include "CDTable.h" - -struct CDRailActivatorComponent { - int32_t id; - std::u16string startAnimation; - std::u16string loopAnimation; - std::u16string stopAnimation; - std::u16string startSound; - std::u16string loopSound; - std::u16string stopSound; - std::pair startEffectID; - std::pair loopEffectID; - std::pair stopEffectID; - std::string preconditions; - bool playerCollision; - bool cameraLocked; - bool damageImmune; - bool noAggro; - bool showNameBillboard; -}; - -class CDRailActivatorComponentTable : public CDTable { -public: - CDRailActivatorComponentTable(); - ~CDRailActivatorComponentTable(); - - std::string GetName() const override; - [[nodiscard]] CDRailActivatorComponent GetEntryByID(int32_t id) const; - [[nodiscard]] std::vector GetEntries() const; -private: - static std::pair EffectPairFromString(std::string& str); - std::vector m_Entries {}; -}; diff --git a/dDatabase/Tables/CDRarityTableIndexTable.cpp b/dDatabase/Tables/CDRarityTableIndexTable.cpp new file mode 100644 index 0000000..76c4056 --- /dev/null +++ b/dDatabase/Tables/CDRarityTableIndexTable.cpp @@ -0,0 +1,45 @@ +#include "CDRarityTableIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.344911 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRarityTableIndexTable::CDRarityTableIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RarityTableIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RarityTableIndex"); + while (!tableData.eof()) { + CDRarityTableIndex entry; + entry.RarityTableIndex = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRarityTableIndexTable::~CDRarityTableIndexTable() { +} + +std::string CDRarityTableIndexTable::GetName(void) const { + return "RarityTableIndex"; +} + +std::vector CDRarityTableIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRarityTableIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRarityTableIndexTable.h b/dDatabase/Tables/CDRarityTableIndexTable.h new file mode 100644 index 0000000..1218a3e --- /dev/null +++ b/dDatabase/Tables/CDRarityTableIndexTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.342916 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRarityTableIndex { + int RarityTableIndex; + std::string description; +}; + +class CDRarityTableIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDRarityTableIndexTable(); + ~CDRarityTableIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRarityTableTable.cpp b/dDatabase/Tables/CDRarityTableTable.cpp index da41e3f..05a19fc 100644 --- a/dDatabase/Tables/CDRarityTableTable.cpp +++ b/dDatabase/Tables/CDRarityTableTable.cpp @@ -1,57 +1,47 @@ #include "CDRarityTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.338921 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDRarityTableTable::CDRarityTableTable(void) { +CDRarityTableTable::CDRarityTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RarityTable"); + 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 RarityTable"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); + this->m_entries.reserve(size); - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RarityTable"); - while (!tableData.eof()) { - CDRarityTable entry; - entry.id = tableData.getIntField(0, -1); - entry.randmax = tableData.getFloatField(1, -1); - entry.rarity = tableData.getIntField(2, -1); - entry.RarityTableIndex = tableData.getIntField(3, -1); - - this->entries.push_back(entry); - tableData.nextRow(); - } + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RarityTable"); + while (!tableData.eof()) { + CDRarityTable entry; + entry.id = tableData.getIntField(0, int{}); + entry.randmax = tableData.getFloatField(1, float{}); + entry.rarity = tableData.getIntField(2, int{}); + entry.RarityTableIndex = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDRarityTableTable::~CDRarityTableTable(void) { } +CDRarityTableTable::~CDRarityTableTable() { +} -//! Returns the table's name std::string CDRarityTableTable::GetName(void) const { - return "RarityTable"; + return "RarityTable"; } -//! Queries the table with a custom "where" clause std::vector CDRarityTableTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + return data; } -//! Gets all the entries in the table -const std::vector& CDRarityTableTable::GetEntries(void) const { - return this->entries; +std::vector CDRarityTableTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDRarityTableTable.h b/dDatabase/Tables/CDRarityTableTable.h index 0a57e90..68eb550 100644 --- a/dDatabase/Tables/CDRarityTableTable.h +++ b/dDatabase/Tables/CDRarityTableTable.h @@ -1,72 +1,24 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDRarityTableTable.hpp - \brief Contains data for the RarityTable table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.337924 +//DO NOT EDIT THIS FILE MANUALLY! - //! RarityTable Entry Struct struct CDRarityTable { - unsigned int id; - float randmax; - unsigned int rarity; - unsigned int RarityTableIndex; - - friend bool operator> (const CDRarityTable& c1, const CDRarityTable& c2) - { - return c1.rarity > c2.rarity; - } - - friend bool operator>= (const CDRarityTable& c1, const CDRarityTable& c2) - { - return c1.rarity >= c2.rarity; - } - - friend bool operator< (const CDRarityTable& c1, const CDRarityTable& c2) - { - return c1.rarity < c2.rarity; - } - - friend bool operator<= (const CDRarityTable& c1, const CDRarityTable& c2) - { - return c1.rarity <= c2.rarity; - } + int id; + float randmax; + int rarity; + int RarityTableIndex; }; - -//! RarityTable table class CDRarityTableTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: + CDRarityTableTable(); + ~CDRarityTableTable(); + std::string GetName(void) const override; - //! Constructor - CDRarityTableTable(void); - - //! Destructor - ~CDRarityTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - const std::vector& GetEntries(void) const; - +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDRebuildComponentTable.cpp b/dDatabase/Tables/CDRebuildComponentTable.cpp index a1b5646..eab94f8 100644 --- a/dDatabase/Tables/CDRebuildComponentTable.cpp +++ b/dDatabase/Tables/CDRebuildComponentTable.cpp @@ -1,63 +1,52 @@ #include "CDRebuildComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.355876 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRebuildComponentTable::CDRebuildComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RebuildComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDRebuildComponentTable::CDRebuildComponentTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RebuildComponent"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RebuildComponent"); - while (!tableData.eof()) { - CDRebuildComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.reset_time = tableData.getFloatField(1, -1.0f); - entry.complete_time = tableData.getFloatField(2, -1.0f); - entry.take_imagination = tableData.getIntField(3, -1); - entry.interruptible = tableData.getIntField(4, -1) == 1 ? true : false; - entry.self_activator = tableData.getIntField(5, -1) == 1 ? true : false; - entry.custom_modules = tableData.getStringField(6, ""); - entry.activityID = tableData.getIntField(7, -1); - entry.post_imagination_cost = tableData.getIntField(8, -1); - entry.time_before_smash = tableData.getFloatField(9, -1.0f); - - this->entries.push_back(entry); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RebuildComponent"); + while (!tableData.eof()) { + CDRebuildComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.reset_time = tableData.getFloatField(1, float{}); + entry.complete_time = tableData.getFloatField(2, float{}); + entry.take_imagination = tableData.getIntField(3, int{}); + entry.interruptible = tableData.getIntField(4, bool{}); + entry.self_activator = tableData.getIntField(5, bool{}); + entry.custom_modules = tableData.getStringField(6, std::string{}.c_str()); + entry.prerequisite_imagination = tableData.getIntField(7, int{}); + entry.activityID = tableData.getIntField(8, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDRebuildComponentTable::~CDRebuildComponentTable(void) { } +CDRebuildComponentTable::~CDRebuildComponentTable() { +} -//! Returns the table's name std::string CDRebuildComponentTable::GetName(void) const { - return "RebuildComponent"; + return "RebuildComponent"; } -//! Queries the table with a custom "where" clause std::vector CDRebuildComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data; + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; } -//! Gets all the entries in the table std::vector CDRebuildComponentTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDRebuildComponentTable.h b/dDatabase/Tables/CDRebuildComponentTable.h index 49d2e44..03fc2e4 100644 --- a/dDatabase/Tables/CDRebuildComponentTable.h +++ b/dDatabase/Tables/CDRebuildComponentTable.h @@ -1,57 +1,29 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDRebuildComponentTable.hpp - \brief Contains data for the RebuildComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.354878 +//DO NOT EDIT THIS FILE MANUALLY! -//! RebuildComponent Struct struct CDRebuildComponent { - unsigned int id; //!< The component Id - float reset_time; //!< The reset time - float complete_time; //!< The complete time - unsigned int take_imagination; //!< The amount of imagination it costs - bool interruptible; //!< Whether or not the rebuild is interruptible - bool self_activator; //!< Whether or not the rebuild is a rebuild activator itself - std::string custom_modules; //!< The custom modules - unsigned int activityID; //!< The activity ID - unsigned int post_imagination_cost; //!< The post imagination cost - float time_before_smash; //!< The time before smash + int id; + float reset_time; + float complete_time; + int take_imagination; + bool interruptible; + bool self_activator; + std::string custom_modules; + int prerequisite_imagination; + int activityID; }; -//! ObjectSkills table class CDRebuildComponentTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDRebuildComponentTable(void); - - //! Destructor - ~CDRebuildComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ - std::vector GetEntries(void) const; - -}; + CDRebuildComponentTable(); + ~CDRebuildComponentTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRebuildSectionsTable.cpp b/dDatabase/Tables/CDRebuildSectionsTable.cpp new file mode 100644 index 0000000..0a226ae --- /dev/null +++ b/dDatabase/Tables/CDRebuildSectionsTable.cpp @@ -0,0 +1,56 @@ +#include "CDRebuildSectionsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.367845 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRebuildSectionsTable::CDRebuildSectionsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RebuildSections"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RebuildSections"); + while (!tableData.eof()) { + CDRebuildSections entry; + entry.id = tableData.getIntField(0, int{}); + entry.rebuildID = tableData.getIntField(1, int{}); + entry.objectID = tableData.getIntField(2, int{}); + entry.offset_x = tableData.getFloatField(3, float{}); + entry.offset_y = tableData.getFloatField(4, float{}); + entry.offset_z = tableData.getFloatField(5, float{}); + entry.fall_angle_x = tableData.getFloatField(6, float{}); + entry.fall_angle_y = tableData.getFloatField(7, float{}); + entry.fall_angle_z = tableData.getFloatField(8, float{}); + entry.fall_height = tableData.getFloatField(9, float{}); + entry.requires_list = tableData.getStringField(10, std::string{}.c_str()); + entry.size = tableData.getIntField(11, int{}); + entry.bPlaced = tableData.getIntField(12, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRebuildSectionsTable::~CDRebuildSectionsTable() { +} + +std::string CDRebuildSectionsTable::GetName(void) const { + return "RebuildSections"; +} + +std::vector CDRebuildSectionsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRebuildSectionsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRebuildSectionsTable.h b/dDatabase/Tables/CDRebuildSectionsTable.h new file mode 100644 index 0000000..fe52ac3 --- /dev/null +++ b/dDatabase/Tables/CDRebuildSectionsTable.h @@ -0,0 +1,33 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.363858 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRebuildSections { + int id; + int rebuildID; + int objectID; + float offset_x; + float offset_y; + float offset_z; + float fall_angle_x; + float fall_angle_y; + float fall_angle_z; + float fall_height; + std::string requires_list; + int size; + bool bPlaced; +}; + +class CDRebuildSectionsTable : public CDTable { +private: + std::vector m_entries; +public: + CDRebuildSectionsTable(); + ~CDRebuildSectionsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRenderComponentFlashTable.cpp b/dDatabase/Tables/CDRenderComponentFlashTable.cpp new file mode 100644 index 0000000..33acf34 --- /dev/null +++ b/dDatabase/Tables/CDRenderComponentFlashTable.cpp @@ -0,0 +1,50 @@ +#include "CDRenderComponentFlashTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.378816 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRenderComponentFlashTable::CDRenderComponentFlashTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RenderComponentFlash"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RenderComponentFlash"); + while (!tableData.eof()) { + CDRenderComponentFlash entry; + entry.id = tableData.getIntField(0, int{}); + entry.interactive = tableData.getIntField(1, bool{}); + entry.animated = tableData.getIntField(2, bool{}); + entry.nodeName = tableData.getStringField(3, std::string{}.c_str()); + entry.flashPath = tableData.getStringField(4, std::string{}.c_str()); + entry.elementName = tableData.getStringField(5, std::string{}.c_str()); + entry._uid = tableData.getIntField(6, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRenderComponentFlashTable::~CDRenderComponentFlashTable() { +} + +std::string CDRenderComponentFlashTable::GetName(void) const { + return "RenderComponentFlash"; +} + +std::vector CDRenderComponentFlashTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRenderComponentFlashTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRenderComponentFlashTable.h b/dDatabase/Tables/CDRenderComponentFlashTable.h new file mode 100644 index 0000000..5686019 --- /dev/null +++ b/dDatabase/Tables/CDRenderComponentFlashTable.h @@ -0,0 +1,27 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.373829 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRenderComponentFlash { + int id; + bool interactive; + bool animated; + std::string nodeName; + std::string flashPath; + std::string elementName; + int _uid; +}; + +class CDRenderComponentFlashTable : public CDTable { +private: + std::vector m_entries; +public: + CDRenderComponentFlashTable(); + ~CDRenderComponentFlashTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRenderComponentTable.cpp b/dDatabase/Tables/CDRenderComponentTable.cpp new file mode 100644 index 0000000..cd64ac8 --- /dev/null +++ b/dDatabase/Tables/CDRenderComponentTable.cpp @@ -0,0 +1,66 @@ +#include "CDRenderComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.371835 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRenderComponentTable::CDRenderComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RenderComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RenderComponent"); + while (!tableData.eof()) { + CDRenderComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.render_asset = tableData.getStringField(1, std::string{}.c_str()); + entry.icon_asset = tableData.getStringField(2, std::string{}.c_str()); + entry.IconID = tableData.getIntField(3, int{}); + entry.shader_id = tableData.getIntField(4, int{}); + entry.effect1 = tableData.getIntField(5, int{}); + entry.effect2 = tableData.getIntField(6, int{}); + entry.effect3 = tableData.getIntField(7, int{}); + entry.effect4 = tableData.getIntField(8, int{}); + entry.effect5 = tableData.getIntField(9, int{}); + entry.effect6 = tableData.getIntField(10, int{}); + entry.footstepType = tableData.getStringField(11, std::string{}.c_str()); + entry.animationGroupID = tableData.getIntField(12, int{}); + entry.fade = tableData.getIntField(13, bool{}); + entry.usedropshadow = tableData.getIntField(14, bool{}); + entry.preloadAnimations = tableData.getIntField(15, bool{}); + entry.fadeInTime = tableData.getFloatField(16, float{}); + entry.maxShadowDistance = tableData.getFloatField(17, float{}); + entry.ignoreCameraCollision = tableData.getIntField(18, bool{}); + entry.renderComponentLOD1 = tableData.getIntField(19, int{}); + entry.renderComponentLOD2 = tableData.getIntField(20, int{}); + entry.gradualSnap = tableData.getIntField(21, bool{}); + entry.animationFlag = tableData.getIntField(22, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRenderComponentTable::~CDRenderComponentTable() { +} + +std::string CDRenderComponentTable::GetName(void) const { + return "RenderComponent"; +} + +std::vector CDRenderComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRenderComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRenderComponentTable.h b/dDatabase/Tables/CDRenderComponentTable.h new file mode 100644 index 0000000..4b20700 --- /dev/null +++ b/dDatabase/Tables/CDRenderComponentTable.h @@ -0,0 +1,43 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.369855 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRenderComponent { + int id; + std::string render_asset; + std::string icon_asset; + int IconID; + int shader_id; + int effect1; + int effect2; + int effect3; + int effect4; + int effect5; + int effect6; + std::string footstepType; + int animationGroupID; + bool fade; + bool usedropshadow; + bool preloadAnimations; + float fadeInTime; + float maxShadowDistance; + bool ignoreCameraCollision; + int renderComponentLOD1; + int renderComponentLOD2; + bool gradualSnap; + int animationFlag; +}; + +class CDRenderComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDRenderComponentTable(); + ~CDRenderComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRenderIconAssetsTable.cpp b/dDatabase/Tables/CDRenderIconAssetsTable.cpp new file mode 100644 index 0000000..453885e --- /dev/null +++ b/dDatabase/Tables/CDRenderIconAssetsTable.cpp @@ -0,0 +1,46 @@ +#include "CDRenderIconAssetsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.383802 +//DO NOT EDIT THIS FILE MANUALLY! + +CDRenderIconAssetsTable::CDRenderIconAssetsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM RenderIconAssets"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM RenderIconAssets"); + while (!tableData.eof()) { + CDRenderIconAssets entry; + entry.id = tableData.getIntField(0, int{}); + entry.icon_asset = tableData.getStringField(1, std::string{}.c_str()); + entry.blank_column = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDRenderIconAssetsTable::~CDRenderIconAssetsTable() { +} + +std::string CDRenderIconAssetsTable::GetName(void) const { + return "RenderIconAssets"; +} + +std::vector CDRenderIconAssetsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDRenderIconAssetsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDRenderIconAssetsTable.h b/dDatabase/Tables/CDRenderIconAssetsTable.h new file mode 100644 index 0000000..172bde5 --- /dev/null +++ b/dDatabase/Tables/CDRenderIconAssetsTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.382804 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDRenderIconAssets { + int id; + std::string icon_asset; + std::string blank_column; +}; + +class CDRenderIconAssetsTable : public CDTable { +private: + std::vector m_entries; +public: + CDRenderIconAssetsTable(); + ~CDRenderIconAssetsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDReputationRewardsTable.cpp b/dDatabase/Tables/CDReputationRewardsTable.cpp new file mode 100644 index 0000000..025ca91 --- /dev/null +++ b/dDatabase/Tables/CDReputationRewardsTable.cpp @@ -0,0 +1,46 @@ +#include "CDReputationRewardsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.387791 +//DO NOT EDIT THIS FILE MANUALLY! + +CDReputationRewardsTable::CDReputationRewardsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ReputationRewards"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ReputationRewards"); + while (!tableData.eof()) { + CDReputationRewards entry; + entry.repLevel = tableData.getIntField(0, int{}); + entry.sublevel = tableData.getIntField(1, int{}); + entry.reputation = tableData.getFloatField(2, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDReputationRewardsTable::~CDReputationRewardsTable() { +} + +std::string CDReputationRewardsTable::GetName(void) const { + return "ReputationRewards"; +} + +std::vector CDReputationRewardsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDReputationRewardsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDReputationRewardsTable.h b/dDatabase/Tables/CDReputationRewardsTable.h new file mode 100644 index 0000000..15fc3e5 --- /dev/null +++ b/dDatabase/Tables/CDReputationRewardsTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.385796 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDReputationRewards { + int repLevel; + int sublevel; + float reputation; +}; + +class CDReputationRewardsTable : public CDTable { +private: + std::vector m_entries; +public: + CDReputationRewardsTable(); + ~CDReputationRewardsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDRewardsTable.cpp b/dDatabase/Tables/CDRewardsTable.cpp deleted file mode 100644 index 2f7d177..0000000 --- a/dDatabase/Tables/CDRewardsTable.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "CDRewardsTable.h" - -CDRewardsTable::CDRewardsTable(void) { - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM Rewards"); - while (!tableData.eof()) { - CDRewards* entry = new CDRewards(); - entry->id = tableData.getIntField(0, -1); - entry->levelID = tableData.getIntField(1, -1); - entry->missionID = tableData.getIntField(2, -1); - entry->rewardType = tableData.getIntField(3, -1); - entry->value = tableData.getIntField(4, -1); - entry->count = tableData.getIntField(5, -1); - - m_entries.insert(std::make_pair(entry->id, entry)); - tableData.nextRow(); - } - - tableData.finalize(); -} - -CDRewardsTable::~CDRewardsTable(void) { - for (auto e : m_entries) { - if (e.second) delete e.second; - } - - m_entries.clear(); -} - -std::string CDRewardsTable::GetName(void) const { - return "Rewards"; -} - -std::vector CDRewardsTable::GetByLevelID(uint32_t levelID) { - std::vector result {}; - for (const auto& e : m_entries) { - if (e.second->levelID == levelID) result.push_back(e.second); - } - - return result; -} diff --git a/dDatabase/Tables/CDRewardsTable.h b/dDatabase/Tables/CDRewardsTable.h deleted file mode 100644 index c4f9fb7..0000000 --- a/dDatabase/Tables/CDRewardsTable.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include "CDTable.h" -#include - -struct CDRewards { - int32_t id; - int32_t levelID; - int32_t missionID; - int32_t rewardType; - int32_t value; - int32_t count; -}; - -class CDRewardsTable : public CDTable { -public: - CDRewardsTable(void); - ~CDRewardsTable(void); - - std::string GetName(void) const override; - std::vector GetByLevelID(uint32_t levelID); - -private: - std::map m_entries; -}; \ No newline at end of file diff --git a/dDatabase/Tables/CDSceneTableTable.cpp b/dDatabase/Tables/CDSceneTableTable.cpp new file mode 100644 index 0000000..8e5545c --- /dev/null +++ b/dDatabase/Tables/CDSceneTableTable.cpp @@ -0,0 +1,45 @@ +#include "CDSceneTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.399760 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSceneTableTable::CDSceneTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SceneTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SceneTable"); + while (!tableData.eof()) { + CDSceneTable entry; + entry.sceneID = tableData.getIntField(0, int{}); + entry.sceneName = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSceneTableTable::~CDSceneTableTable() { +} + +std::string CDSceneTableTable::GetName(void) const { + return "SceneTable"; +} + +std::vector CDSceneTableTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSceneTableTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSceneTableTable.h b/dDatabase/Tables/CDSceneTableTable.h new file mode 100644 index 0000000..18c0049 --- /dev/null +++ b/dDatabase/Tables/CDSceneTableTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.390783 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSceneTable { + int sceneID; + std::string sceneName; +}; + +class CDSceneTableTable : public CDTable { +private: + std::vector m_entries; +public: + CDSceneTableTable(); + ~CDSceneTableTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDScriptComponentTable.cpp b/dDatabase/Tables/CDScriptComponentTable.cpp index 11ab75e..d642fb1 100644 --- a/dDatabase/Tables/CDScriptComponentTable.cpp +++ b/dDatabase/Tables/CDScriptComponentTable.cpp @@ -1,47 +1,46 @@ #include "CDScriptComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.404746 +//DO NOT EDIT THIS FILE MANUALLY! + +CDScriptComponentTable::CDScriptComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ScriptComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! 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(); - } - 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, ""); - - this->entries.insert(std::make_pair(entry.id, entry)); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ScriptComponent"); + while (!tableData.eof()) { + CDScriptComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.script_name = tableData.getStringField(1, std::string{}.c_str()); + entry.client_script_name = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDScriptComponentTable::~CDScriptComponentTable(void) { } - -//! Returns the table's name -std::string CDScriptComponentTable::GetName(void) const { - return "ScriptComponent"; +CDScriptComponentTable::~CDScriptComponentTable() { } -const CDScriptComponent& CDScriptComponentTable::GetByID(unsigned int id) { - std::map::iterator it = this->entries.find(id); - if (it != this->entries.end()) { - return it->second; - } +std::string CDScriptComponentTable::GetName(void) const { + return "ScriptComponent"; +} - return m_ToReturnWhenNoneFound; -} \ No newline at end of file +std::vector CDScriptComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDScriptComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDScriptComponentTable.h b/dDatabase/Tables/CDScriptComponentTable.h index 7fc802f..62ff584 100644 --- a/dDatabase/Tables/CDScriptComponentTable.h +++ b/dDatabase/Tables/CDScriptComponentTable.h @@ -1,46 +1,23 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDScriptComponentTable.hpp - \brief Contains data for the ScriptComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.403749 +//DO NOT EDIT THIS FILE MANUALLY! -//! ScriptComponent Struct struct CDScriptComponent { - unsigned int id; //!< The component ID - std::string script_name; //!< The script name - std::string client_script_name; //!< The client script name + int id; + std::string script_name; + std::string client_script_name; }; -//! ObjectSkills table class CDScriptComponentTable : public CDTable { private: - std::map entries; - CDScriptComponent m_ToReturnWhenNoneFound; - + std::vector m_entries; public: - //! Gets an entry by ID - const CDScriptComponent& GetByID(unsigned int id); - - //! Constructor - CDScriptComponentTable(void); - - //! Destructor - ~CDScriptComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - -}; + CDScriptComponentTable(); + ~CDScriptComponentTable(); + std::string GetName(void) const override; +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSkillBehaviorTable.cpp b/dDatabase/Tables/CDSkillBehaviorTable.cpp index ad79997..67b8ede 100644 --- a/dDatabase/Tables/CDSkillBehaviorTable.cpp +++ b/dDatabase/Tables/CDSkillBehaviorTable.cpp @@ -1,84 +1,63 @@ #include "CDSkillBehaviorTable.h" -//#include "Logger.hpp" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.410733 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDSkillBehaviorTable::CDSkillBehaviorTable(void) { - m_empty = CDSkillBehavior(); +CDSkillBehaviorTable::CDSkillBehaviorTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SkillBehavior"); + 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 SkillBehavior"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Reserve the size - //this->entries.reserve(size); + this->m_entries.reserve(size); - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SkillBehavior"); - while (!tableData.eof()) { - CDSkillBehavior entry; - entry.skillID = tableData.getIntField(0, -1); - UNUSED(entry.locStatus = tableData.getIntField(1, -1)); - entry.behaviorID = tableData.getIntField(2, -1); - entry.imaginationcost = tableData.getIntField(3, -1); - entry.cooldowngroup = tableData.getIntField(4, -1); - entry.cooldown = tableData.getFloatField(5, -1.0f); - UNUSED(entry.isNpcEditor = tableData.getIntField(6, -1) == 1 ? true : false); - UNUSED(entry.skillIcon = tableData.getIntField(7, -1)); - UNUSED(entry.oomSkillID = tableData.getStringField(8, "")); - UNUSED(entry.oomBehaviorEffectID = tableData.getIntField(9, -1)); - UNUSED(entry.castTypeDesc = tableData.getIntField(10, -1)); - UNUSED(entry.imBonusUI = tableData.getIntField(11, -1)); - UNUSED(entry.lifeBonusUI = tableData.getIntField(12, -1)); - UNUSED(entry.armorBonusUI = tableData.getIntField(13, -1)); - UNUSED(entry.damageUI = tableData.getIntField(14, -1)); - UNUSED(entry.hideIcon = tableData.getIntField(15, -1) == 1 ? true : false); - UNUSED(entry.localize = tableData.getIntField(16, -1) == 1 ? true : false); - UNUSED(entry.gate_version = tableData.getStringField(17, "")); - UNUSED(entry.cancelType = tableData.getIntField(18, -1)); - - this->entries.insert(std::make_pair(entry.skillID, entry)); - //this->entries.push_back(entry); - tableData.nextRow(); - } + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SkillBehavior"); + while (!tableData.eof()) { + CDSkillBehavior entry; + entry.skillID = tableData.getIntField(0, int{}); + entry.behaviorID = tableData.getIntField(1, int{}); + entry.name = tableData.getStringField(2, std::string{}.c_str()); + entry.description = tableData.getStringField(3, std::string{}.c_str()); + entry.imaginationcost = tableData.getIntField(4, int{}); + entry.cooldowngroup = tableData.getIntField(5, int{}); + entry.cooldown = tableData.getFloatField(6, float{}); + entry.inNpcEditor = tableData.getIntField(7, bool{}); + entry.skillIcon = tableData.getIntField(8, int{}); + entry.oomSkillID = tableData.getStringField(9, std::string{}.c_str()); + entry.oomBehaviorEffectID = tableData.getIntField(10, int{}); + entry.castTypeDesc = tableData.getIntField(11, int{}); + entry.imBonusUI = tableData.getIntField(12, int{}); + entry.lifeBonusUI = tableData.getIntField(13, int{}); + entry.armorBonusUI = tableData.getIntField(14, int{}); + entry.imHealUI = tableData.getIntField(15, int{}); + entry.lifeHealUI = tableData.getIntField(16, int{}); + entry.armorHealUI = tableData.getIntField(17, int{}); + entry.damageUI = tableData.getIntField(18, int{}); + entry.descriptionUI = tableData.getStringField(19, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDSkillBehaviorTable::~CDSkillBehaviorTable(void) { } - -//! Returns the table's name -std::string CDSkillBehaviorTable::GetName(void) const { - return "SkillBehavior"; +CDSkillBehaviorTable::~CDSkillBehaviorTable() { +} + +std::string CDSkillBehaviorTable::GetName(void) const { + return "SkillBehavior"; } -//! Queries the table with a custom "where" clause std::vector CDSkillBehaviorTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); - /*std::vector data = cpplinq::from(this->entries) - >> cpplinq::where(predicate) - >> cpplinq::to_vector(); - - return data;*/ - - //Logger::LogDebug("CDSkillBehaviorTable", "The 'Query' function is no longer working! Please use GetSkillByID instead!\n"); - std::vector data; //So MSVC shuts up return data; } -//! Gets an entry by ID -const CDSkillBehavior& CDSkillBehaviorTable::GetSkillByID(unsigned int skillID) { - std::map::iterator it = this->entries.find(skillID); - if (it != this->entries.end()) { - return it->second; - } - - return m_empty; +std::vector CDSkillBehaviorTable::GetEntries(void) const { + return this->m_entries; } diff --git a/dDatabase/Tables/CDSkillBehaviorTable.h b/dDatabase/Tables/CDSkillBehaviorTable.h index d70dca5..f57b320 100644 --- a/dDatabase/Tables/CDSkillBehaviorTable.h +++ b/dDatabase/Tables/CDSkillBehaviorTable.h @@ -1,63 +1,40 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDSkillBehaviorTable.hpp - \brief Contains data for the SkillBehavior table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.406740 +//DO NOT EDIT THIS FILE MANUALLY! -//! ZoneTable Struct struct CDSkillBehavior { - unsigned int skillID; //!< The Skill ID of the skill - UNUSED(unsigned int locStatus); //!< ?? - unsigned int behaviorID; //!< The Behavior ID of the skill - unsigned int imaginationcost; //!< The imagination cost of the skill - unsigned int cooldowngroup; //!< The cooldown group ID of the skill - float cooldown; //!< The cooldown time of the skill - UNUSED(bool isNpcEditor); //!< ??? - UNUSED(unsigned int skillIcon); //!< The Skill Icon ID - UNUSED(std::string oomSkillID); //!< ??? - UNUSED(unsigned int oomBehaviorEffectID); //!< ??? - UNUSED(unsigned int castTypeDesc); //!< The cast type description(?) - UNUSED(unsigned int imBonusUI); //!< The imagination bonus of the skill - UNUSED(nsigned int lifeBonusUI); //!< The life bonus of the skill - UNUSED(unsigned int armorBonusUI); //!< The armor bonus of the skill - UNUSED(unsigned int damageUI); //!< ??? - UNUSED(bool hideIcon); //!< Whether or not to show the icon - UNUSED(bool localize); //!< ??? - UNUSED(std::string gate_version); //!< ??? - UNUSED(unsigned int cancelType); //!< The cancel type (?) + int skillID; + int behaviorID; + std::string name; + std::string description; + int imaginationcost; + int cooldowngroup; + float cooldown; + bool inNpcEditor; + int skillIcon; + std::string oomSkillID; + int oomBehaviorEffectID; + int castTypeDesc; + int imBonusUI; + int lifeBonusUI; + int armorBonusUI; + int imHealUI; + int lifeHealUI; + int armorHealUI; + int damageUI; + std::string descriptionUI; }; -//! SkillBehavior table class CDSkillBehaviorTable : public CDTable { private: - std::map entries; - CDSkillBehavior m_empty; - + std::vector m_entries; public: + CDSkillBehaviorTable(); + ~CDSkillBehaviorTable(); + std::string GetName(void) const override; - //! Constructor - CDSkillBehaviorTable(void); - - //! Destructor - ~CDSkillBehaviorTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets an entry by ID - const CDSkillBehavior& GetSkillByID(unsigned int skillID); +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; }; - diff --git a/dDatabase/Tables/CDSmashableChainIndexTable.cpp b/dDatabase/Tables/CDSmashableChainIndexTable.cpp new file mode 100644 index 0000000..61d63c8 --- /dev/null +++ b/dDatabase/Tables/CDSmashableChainIndexTable.cpp @@ -0,0 +1,47 @@ +#include "CDSmashableChainIndexTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.421700 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSmashableChainIndexTable::CDSmashableChainIndexTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SmashableChainIndex"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SmashableChainIndex"); + while (!tableData.eof()) { + CDSmashableChainIndex entry; + entry.id = tableData.getIntField(0, int{}); + entry.targetGroup = tableData.getStringField(1, std::string{}.c_str()); + entry.description = tableData.getStringField(2, std::string{}.c_str()); + entry.continuous = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSmashableChainIndexTable::~CDSmashableChainIndexTable() { +} + +std::string CDSmashableChainIndexTable::GetName(void) const { + return "SmashableChainIndex"; +} + +std::vector CDSmashableChainIndexTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSmashableChainIndexTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSmashableChainIndexTable.h b/dDatabase/Tables/CDSmashableChainIndexTable.h new file mode 100644 index 0000000..30b028a --- /dev/null +++ b/dDatabase/Tables/CDSmashableChainIndexTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.419707 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSmashableChainIndex { + int id; + std::string targetGroup; + std::string description; + int continuous; +}; + +class CDSmashableChainIndexTable : public CDTable { +private: + std::vector m_entries; +public: + CDSmashableChainIndexTable(); + ~CDSmashableChainIndexTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSmashableChainTable.cpp b/dDatabase/Tables/CDSmashableChainTable.cpp new file mode 100644 index 0000000..d6bd24d --- /dev/null +++ b/dDatabase/Tables/CDSmashableChainTable.cpp @@ -0,0 +1,52 @@ +#include "CDSmashableChainTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.417711 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSmashableChainTable::CDSmashableChainTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SmashableChain"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SmashableChain"); + while (!tableData.eof()) { + CDSmashableChain entry; + entry.chainIndex = tableData.getIntField(0, int{}); + entry.chainLevel = tableData.getIntField(1, int{}); + entry.lootMatrixID = tableData.getIntField(2, int{}); + entry.rarityTableIndex = tableData.getIntField(3, int{}); + entry.currencyIndex = tableData.getIntField(4, int{}); + entry.currencyLevel = tableData.getIntField(5, int{}); + entry.smashCount = tableData.getIntField(6, int{}); + entry.timeLimit = tableData.getIntField(7, int{}); + entry.chainStepID = tableData.getIntField(8, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSmashableChainTable::~CDSmashableChainTable() { +} + +std::string CDSmashableChainTable::GetName(void) const { + return "SmashableChain"; +} + +std::vector CDSmashableChainTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSmashableChainTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSmashableChainTable.h b/dDatabase/Tables/CDSmashableChainTable.h new file mode 100644 index 0000000..9056caa --- /dev/null +++ b/dDatabase/Tables/CDSmashableChainTable.h @@ -0,0 +1,29 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.415849 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSmashableChain { + int chainIndex; + int chainLevel; + int lootMatrixID; + int rarityTableIndex; + int currencyIndex; + int currencyLevel; + int smashCount; + int timeLimit; + int chainStepID; +}; + +class CDSmashableChainTable : public CDTable { +private: + std::vector m_entries; +public: + CDSmashableChainTable(); + ~CDSmashableChainTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSmashableComponentTable.cpp b/dDatabase/Tables/CDSmashableComponentTable.cpp new file mode 100644 index 0000000..861d0c2 --- /dev/null +++ b/dDatabase/Tables/CDSmashableComponentTable.cpp @@ -0,0 +1,45 @@ +#include "CDSmashableComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.426795 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSmashableComponentTable::CDSmashableComponentTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SmashableComponent"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SmashableComponent"); + while (!tableData.eof()) { + CDSmashableComponent entry; + entry.id = tableData.getIntField(0, int{}); + entry.LootMatrixIndex = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSmashableComponentTable::~CDSmashableComponentTable() { +} + +std::string CDSmashableComponentTable::GetName(void) const { + return "SmashableComponent"; +} + +std::vector CDSmashableComponentTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSmashableComponentTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSmashableComponentTable.h b/dDatabase/Tables/CDSmashableComponentTable.h new file mode 100644 index 0000000..a3fb94c --- /dev/null +++ b/dDatabase/Tables/CDSmashableComponentTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.423695 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSmashableComponent { + int id; + int LootMatrixIndex; +}; + +class CDSmashableComponentTable : public CDTable { +private: + std::vector m_entries; +public: + CDSmashableComponentTable(); + ~CDSmashableComponentTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSmashableElementsTable.cpp b/dDatabase/Tables/CDSmashableElementsTable.cpp new file mode 100644 index 0000000..bc74064 --- /dev/null +++ b/dDatabase/Tables/CDSmashableElementsTable.cpp @@ -0,0 +1,45 @@ +#include "CDSmashableElementsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.431674 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSmashableElementsTable::CDSmashableElementsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SmashableElements"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SmashableElements"); + while (!tableData.eof()) { + CDSmashableElements entry; + entry.elementID = tableData.getIntField(0, int{}); + entry.dropWeight = tableData.getIntField(1, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSmashableElementsTable::~CDSmashableElementsTable() { +} + +std::string CDSmashableElementsTable::GetName(void) const { + return "SmashableElements"; +} + +std::vector CDSmashableElementsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSmashableElementsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSmashableElementsTable.h b/dDatabase/Tables/CDSmashableElementsTable.h new file mode 100644 index 0000000..437c2df --- /dev/null +++ b/dDatabase/Tables/CDSmashableElementsTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.429679 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSmashableElements { + int elementID; + int dropWeight; +}; + +class CDSmashableElementsTable : public CDTable { +private: + std::vector m_entries; +public: + CDSmashableElementsTable(); + ~CDSmashableElementsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSpeedchatMenuTable.cpp b/dDatabase/Tables/CDSpeedchatMenuTable.cpp new file mode 100644 index 0000000..52c26c4 --- /dev/null +++ b/dDatabase/Tables/CDSpeedchatMenuTable.cpp @@ -0,0 +1,48 @@ +#include "CDSpeedchatMenuTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.433668 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSpeedchatMenuTable::CDSpeedchatMenuTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SpeedchatMenu"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SpeedchatMenu"); + while (!tableData.eof()) { + CDSpeedchatMenu entry; + entry.id = tableData.getIntField(0, int{}); + entry.parentId = tableData.getIntField(1, int{}); + entry.emoteId = tableData.getIntField(2, int{}); + entry.menuText = tableData.getStringField(3, std::string{}.c_str()); + entry.imageName = tableData.getStringField(4, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSpeedchatMenuTable::~CDSpeedchatMenuTable() { +} + +std::string CDSpeedchatMenuTable::GetName(void) const { + return "SpeedchatMenu"; +} + +std::vector CDSpeedchatMenuTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSpeedchatMenuTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSpeedchatMenuTable.h b/dDatabase/Tables/CDSpeedchatMenuTable.h new file mode 100644 index 0000000..9003aab --- /dev/null +++ b/dDatabase/Tables/CDSpeedchatMenuTable.h @@ -0,0 +1,25 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.432671 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSpeedchatMenu { + int id; + int parentId; + int emoteId; + std::string menuText; + std::string imageName; +}; + +class CDSpeedchatMenuTable : public CDTable { +private: + std::vector m_entries; +public: + CDSpeedchatMenuTable(); + ~CDSpeedchatMenuTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDSurfaceTypeTable.cpp b/dDatabase/Tables/CDSurfaceTypeTable.cpp new file mode 100644 index 0000000..7f6267e --- /dev/null +++ b/dDatabase/Tables/CDSurfaceTypeTable.cpp @@ -0,0 +1,46 @@ +#include "CDSurfaceTypeTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.437657 +//DO NOT EDIT THIS FILE MANUALLY! + +CDSurfaceTypeTable::CDSurfaceTypeTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM SurfaceType"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM SurfaceType"); + while (!tableData.eof()) { + CDSurfaceType entry; + entry.SurfaceType = tableData.getIntField(0, int{}); + entry.Name = tableData.getStringField(1, std::string{}.c_str()); + entry.FootstepNDAudioMetaEventSetName = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDSurfaceTypeTable::~CDSurfaceTypeTable() { +} + +std::string CDSurfaceTypeTable::GetName(void) const { + return "SurfaceType"; +} + +std::vector CDSurfaceTypeTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDSurfaceTypeTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDSurfaceTypeTable.h b/dDatabase/Tables/CDSurfaceTypeTable.h new file mode 100644 index 0000000..0f90fb2 --- /dev/null +++ b/dDatabase/Tables/CDSurfaceTypeTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.436660 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDSurfaceType { + int SurfaceType; + std::string Name; + std::string FootstepNDAudioMetaEventSetName; +}; + +class CDSurfaceTypeTable : public CDTable { +private: + std::vector m_entries; +public: + CDSurfaceTypeTable(); + ~CDSurfaceTypeTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDTable.h b/dDatabase/Tables/CDTable.h index ec056e8..dc0921e 100644 --- a/dDatabase/Tables/CDTable.h +++ b/dDatabase/Tables/CDTable.h @@ -38,4 +38,4 @@ public: \return The table name */ virtual std::string GetName() const = 0; -}; +}; \ No newline at end of file diff --git a/dDatabase/Tables/CDTamingBuildPuzzlesTable.cpp b/dDatabase/Tables/CDTamingBuildPuzzlesTable.cpp new file mode 100644 index 0000000..4fda1d6 --- /dev/null +++ b/dDatabase/Tables/CDTamingBuildPuzzlesTable.cpp @@ -0,0 +1,56 @@ +#include "CDTamingBuildPuzzlesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.446634 +//DO NOT EDIT THIS FILE MANUALLY! + +CDTamingBuildPuzzlesTable::CDTamingBuildPuzzlesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM TamingBuildPuzzles"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM TamingBuildPuzzles"); + while (!tableData.eof()) { + CDTamingBuildPuzzles entry; + entry.id = tableData.getIntField(0, int{}); + entry.PuzzleModelLot = tableData.getIntField(1, int{}); + entry.NPCLot = tableData.getIntField(2, int{}); + entry.ValidPiecesLXF = tableData.getStringField(3, std::string{}.c_str()); + entry.InvalidPiecesLXF = tableData.getStringField(4, std::string{}.c_str()); + entry.Difficulty = tableData.getIntField(5, int{}); + entry.Timelimit = tableData.getIntField(6, int{}); + entry.NumValidPieces = tableData.getIntField(7, int{}); + entry.TotalNumPieces = tableData.getIntField(8, int{}); + entry.ModelName = tableData.getStringField(9, std::string{}.c_str()); + entry.FullModelLXF = tableData.getStringField(10, std::string{}.c_str()); + entry.Duration = tableData.getFloatField(11, float{}); + entry.imagCostPerBuild = tableData.getIntField(12, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDTamingBuildPuzzlesTable::~CDTamingBuildPuzzlesTable() { +} + +std::string CDTamingBuildPuzzlesTable::GetName(void) const { + return "TamingBuildPuzzles"; +} + +std::vector CDTamingBuildPuzzlesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDTamingBuildPuzzlesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDTamingBuildPuzzlesTable.h b/dDatabase/Tables/CDTamingBuildPuzzlesTable.h new file mode 100644 index 0000000..621121e --- /dev/null +++ b/dDatabase/Tables/CDTamingBuildPuzzlesTable.h @@ -0,0 +1,33 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.444639 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDTamingBuildPuzzles { + int id; + int PuzzleModelLot; + int NPCLot; + std::string ValidPiecesLXF; + std::string InvalidPiecesLXF; + int Difficulty; + int Timelimit; + int NumValidPieces; + int TotalNumPieces; + std::string ModelName; + std::string FullModelLXF; + float Duration; + int imagCostPerBuild; +}; + +class CDTamingBuildPuzzlesTable : public CDTable { +private: + std::vector m_entries; +public: + CDTamingBuildPuzzlesTable(); + ~CDTamingBuildPuzzlesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDTextDescriptionTable.cpp b/dDatabase/Tables/CDTextDescriptionTable.cpp new file mode 100644 index 0000000..9d7540c --- /dev/null +++ b/dDatabase/Tables/CDTextDescriptionTable.cpp @@ -0,0 +1,45 @@ +#include "CDTextDescriptionTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.455609 +//DO NOT EDIT THIS FILE MANUALLY! + +CDTextDescriptionTable::CDTextDescriptionTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM TextDescription"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM TextDescription"); + while (!tableData.eof()) { + CDTextDescription entry; + entry.TextID = tableData.getIntField(0, int{}); + entry.TestDescription = tableData.getStringField(1, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDTextDescriptionTable::~CDTextDescriptionTable() { +} + +std::string CDTextDescriptionTable::GetName(void) const { + return "TextDescription"; +} + +std::vector CDTextDescriptionTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDTextDescriptionTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDTextDescriptionTable.h b/dDatabase/Tables/CDTextDescriptionTable.h new file mode 100644 index 0000000..50ad963 --- /dev/null +++ b/dDatabase/Tables/CDTextDescriptionTable.h @@ -0,0 +1,22 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.454612 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDTextDescription { + int TextID; + std::string TestDescription; +}; + +class CDTextDescriptionTable : public CDTable { +private: + std::vector m_entries; +public: + CDTextDescriptionTable(); + ~CDTextDescriptionTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDTextLanguageTable.cpp b/dDatabase/Tables/CDTextLanguageTable.cpp new file mode 100644 index 0000000..7f99721 --- /dev/null +++ b/dDatabase/Tables/CDTextLanguageTable.cpp @@ -0,0 +1,46 @@ +#include "CDTextLanguageTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.457605 +//DO NOT EDIT THIS FILE MANUALLY! + +CDTextLanguageTable::CDTextLanguageTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM TextLanguage"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM TextLanguage"); + while (!tableData.eof()) { + CDTextLanguage entry; + entry.TextID = tableData.getIntField(0, int{}); + entry.LanguageID = tableData.getIntField(1, int{}); + entry.Text = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDTextLanguageTable::~CDTextLanguageTable() { +} + +std::string CDTextLanguageTable::GetName(void) const { + return "TextLanguage"; +} + +std::vector CDTextLanguageTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDTextLanguageTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDTextLanguageTable.h b/dDatabase/Tables/CDTextLanguageTable.h new file mode 100644 index 0000000..24653b3 --- /dev/null +++ b/dDatabase/Tables/CDTextLanguageTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.456607 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDTextLanguage { + int TextID; + int LanguageID; + std::string Text; +}; + +class CDTextLanguageTable : public CDTable { +private: + std::vector m_entries; +public: + CDTextLanguageTable(); + ~CDTextLanguageTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDTrailEffectsTable.cpp b/dDatabase/Tables/CDTrailEffectsTable.cpp new file mode 100644 index 0000000..d796d27 --- /dev/null +++ b/dDatabase/Tables/CDTrailEffectsTable.cpp @@ -0,0 +1,70 @@ +#include "CDTrailEffectsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.464585 +//DO NOT EDIT THIS FILE MANUALLY! + +CDTrailEffectsTable::CDTrailEffectsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM TrailEffects"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM TrailEffects"); + while (!tableData.eof()) { + CDTrailEffects entry; + entry.trailID = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.textureName = tableData.getStringField(2, std::string{}.c_str()); + entry.blendmode = tableData.getIntField(3, int{}); + entry.cardlifetime = tableData.getFloatField(4, float{}); + entry.colorlifetime = tableData.getFloatField(5, float{}); + entry.minTailFade = tableData.getFloatField(6, float{}); + entry.tailFade = tableData.getFloatField(7, float{}); + entry.max_particles = tableData.getIntField(8, int{}); + entry.birthDelay = tableData.getFloatField(9, float{}); + entry.deathDelay = tableData.getFloatField(10, float{}); + entry.bone1 = tableData.getStringField(11, std::string{}.c_str()); + entry.bone2 = tableData.getStringField(12, std::string{}.c_str()); + entry.texLength = tableData.getFloatField(13, float{}); + entry.texWidth = tableData.getFloatField(14, float{}); + entry.startColorR = tableData.getFloatField(15, float{}); + entry.startColorG = tableData.getFloatField(16, float{}); + entry.startColorB = tableData.getFloatField(17, float{}); + entry.startColorA = tableData.getFloatField(18, float{}); + entry.middleColorR = tableData.getFloatField(19, float{}); + entry.middleColorG = tableData.getFloatField(20, float{}); + entry.middleColorB = tableData.getFloatField(21, float{}); + entry.middleColorA = tableData.getFloatField(22, float{}); + entry.endColorR = tableData.getFloatField(23, float{}); + entry.endColorG = tableData.getFloatField(24, float{}); + entry.endColorB = tableData.getFloatField(25, float{}); + entry.endColorA = tableData.getFloatField(26, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDTrailEffectsTable::~CDTrailEffectsTable() { +} + +std::string CDTrailEffectsTable::GetName(void) const { + return "TrailEffects"; +} + +std::vector CDTrailEffectsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDTrailEffectsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDTrailEffectsTable.h b/dDatabase/Tables/CDTrailEffectsTable.h new file mode 100644 index 0000000..ef534c1 --- /dev/null +++ b/dDatabase/Tables/CDTrailEffectsTable.h @@ -0,0 +1,47 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.462594 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDTrailEffects { + int trailID; + std::string description; + std::string textureName; + int blendmode; + float cardlifetime; + float colorlifetime; + float minTailFade; + float tailFade; + int max_particles; + float birthDelay; + float deathDelay; + std::string bone1; + std::string bone2; + float texLength; + float texWidth; + float startColorR; + float startColorG; + float startColorB; + float startColorA; + float middleColorR; + float middleColorG; + float middleColorB; + float middleColorA; + float endColorR; + float endColorG; + float endColorB; + float endColorA; +}; + +class CDTrailEffectsTable : public CDTable { +private: + std::vector m_entries; +public: + CDTrailEffectsTable(); + ~CDTrailEffectsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDVehiclePhysicsTable.cpp b/dDatabase/Tables/CDVehiclePhysicsTable.cpp new file mode 100644 index 0000000..5047f63 --- /dev/null +++ b/dDatabase/Tables/CDVehiclePhysicsTable.cpp @@ -0,0 +1,146 @@ +#include "CDVehiclePhysicsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.469647 +//DO NOT EDIT THIS FILE MANUALLY! + +CDVehiclePhysicsTable::CDVehiclePhysicsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM VehiclePhysics"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VehiclePhysics"); + while (!tableData.eof()) { + CDVehiclePhysics entry; + entry.id = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + entry.hkxFilename = tableData.getStringField(2, std::string{}.c_str()); + entry.fGravityScale = tableData.getFloatField(3, float{}); + entry.fMass = tableData.getFloatField(4, float{}); + entry.fChassisFriction = tableData.getFloatField(5, float{}); + entry.fMaxSpeed = tableData.getFloatField(6, float{}); + entry.fEngineTorque = tableData.getFloatField(7, float{}); + entry.fBrakeFrontTorque = tableData.getFloatField(8, float{}); + entry.fBrakeRearTorque = tableData.getFloatField(9, float{}); + entry.fBrakeMinInputToBlock = tableData.getFloatField(10, float{}); + entry.fBrakeMinTimeToBlock = tableData.getFloatField(11, float{}); + entry.fSteeringMaxAngle = tableData.getFloatField(12, float{}); + entry.fSteeringSpeedLimitForMaxAngle = tableData.getFloatField(13, float{}); + entry.fSteeringMinAngle = tableData.getFloatField(14, float{}); + entry.fFwdBias = tableData.getFloatField(15, float{}); + entry.fFrontTireFriction = tableData.getFloatField(16, float{}); + entry.fRearTireFriction = tableData.getFloatField(17, float{}); + entry.fFrontTireFrictionSlide = tableData.getFloatField(18, float{}); + entry.fRearTireFrictionSlide = tableData.getFloatField(19, float{}); + entry.fFrontTireSlipAngle = tableData.getFloatField(20, float{}); + entry.fRearTireSlipAngle = tableData.getFloatField(21, float{}); + entry.fWheelWidth = tableData.getFloatField(22, float{}); + entry.fWheelRadius = tableData.getFloatField(23, float{}); + entry.fWheelMass = tableData.getFloatField(24, float{}); + entry.fReorientPitchStrength = tableData.getFloatField(25, float{}); + entry.fReorientRollStrength = tableData.getFloatField(26, float{}); + entry.fSuspensionLength = tableData.getFloatField(27, float{}); + entry.fSuspensionStrength = tableData.getFloatField(28, float{}); + entry.fSuspensionDampingCompression = tableData.getFloatField(29, float{}); + entry.fSuspensionDampingRelaxation = tableData.getFloatField(30, float{}); + entry.iChassisCollisionGroup = tableData.getIntField(31, int{}); + entry.fNormalSpinDamping = tableData.getFloatField(32, float{}); + entry.fCollisionSpinDamping = tableData.getFloatField(33, float{}); + entry.fCollisionThreshold = tableData.getFloatField(34, float{}); + entry.fTorqueRollFactor = tableData.getFloatField(35, float{}); + entry.fTorquePitchFactor = tableData.getFloatField(36, float{}); + entry.fTorqueYawFactor = tableData.getFloatField(37, float{}); + entry.fInertiaRoll = tableData.getFloatField(38, float{}); + entry.fInertiaPitch = tableData.getFloatField(39, float{}); + entry.fInertiaYaw = tableData.getFloatField(40, float{}); + entry.fExtraTorqueFactor = tableData.getFloatField(41, float{}); + entry.fCenterOfMassFwd = tableData.getFloatField(42, float{}); + entry.fCenterOfMassUp = tableData.getFloatField(43, float{}); + entry.fCenterOfMassRight = tableData.getFloatField(44, float{}); + entry.fWheelHardpointFrontFwd = tableData.getFloatField(45, float{}); + entry.fWheelHardpointFrontUp = tableData.getFloatField(46, float{}); + entry.fWheelHardpointFrontRight = tableData.getFloatField(47, float{}); + entry.fWheelHardpointRearFwd = tableData.getFloatField(48, float{}); + entry.fWheelHardpointRearUp = tableData.getFloatField(49, float{}); + entry.fWheelHardpointRearRight = tableData.getFloatField(50, float{}); + entry.fInputTurnSpeed = tableData.getFloatField(51, float{}); + entry.fInputDeadTurnBackSpeed = tableData.getFloatField(52, float{}); + entry.fInputAccelSpeed = tableData.getFloatField(53, float{}); + entry.fInputDeadAccelDownSpeed = tableData.getFloatField(54, float{}); + entry.fInputDecelSpeed = tableData.getFloatField(55, float{}); + entry.fInputDeadDecelDownSpeed = tableData.getFloatField(56, float{}); + entry.fInputSlopeChangePointX = tableData.getFloatField(57, float{}); + entry.fInputInitialSlope = tableData.getFloatField(58, float{}); + entry.fInputDeadZone = tableData.getFloatField(59, float{}); + entry.fAeroAirDensity = tableData.getFloatField(60, float{}); + entry.fAeroFrontalArea = tableData.getFloatField(61, float{}); + entry.fAeroDragCoefficient = tableData.getFloatField(62, float{}); + entry.fAeroLiftCoefficient = tableData.getFloatField(63, float{}); + entry.fAeroExtraGravity = tableData.getFloatField(64, float{}); + entry.fBoostTopSpeed = tableData.getFloatField(65, float{}); + entry.fBoostCostPerSecond = tableData.getFloatField(66, float{}); + entry.fBoostAccelerateChange = tableData.getFloatField(67, float{}); + entry.fBoostDampingChange = tableData.getFloatField(68, float{}); + entry.fPowerslideNeutralAngle = tableData.getFloatField(69, float{}); + entry.fPowerslideTorqueStrength = tableData.getFloatField(70, float{}); + entry.iPowerslideNumTorqueApplications = tableData.getIntField(71, int{}); + entry.fImaginationTankSize = tableData.getFloatField(72, float{}); + entry.fSkillCost = tableData.getFloatField(73, float{}); + entry.fWreckSpeedBase = tableData.getFloatField(74, float{}); + entry.fWreckSpeedPercent = tableData.getFloatField(75, float{}); + entry.fWreckMinAngle = tableData.getFloatField(76, float{}); + entry.AudioEventEngine = tableData.getStringField(77, std::string{}.c_str()); + entry.AudioEventSkid = tableData.getStringField(78, std::string{}.c_str()); + entry.AudioEventLightHit = tableData.getStringField(79, std::string{}.c_str()); + entry.AudioSpeedThresholdLightHit = tableData.getFloatField(80, float{}); + entry.AudioTimeoutLightHit = tableData.getFloatField(81, float{}); + entry.AudioEventHeavyHit = tableData.getStringField(82, std::string{}.c_str()); + entry.AudioSpeedThresholdHeavyHit = tableData.getFloatField(83, float{}); + entry.AudioTimeoutHeavyHit = tableData.getFloatField(84, float{}); + entry.AudioEventStart = tableData.getStringField(85, std::string{}.c_str()); + entry.AudioEventTreadConcrete = tableData.getStringField(86, std::string{}.c_str()); + entry.AudioEventTreadSand = tableData.getStringField(87, std::string{}.c_str()); + entry.AudioEventTreadWood = tableData.getStringField(88, std::string{}.c_str()); + entry.AudioEventTreadDirt = tableData.getStringField(89, std::string{}.c_str()); + entry.AudioEventTreadPlastic = tableData.getStringField(90, std::string{}.c_str()); + entry.AudioEventTreadGrass = tableData.getStringField(91, std::string{}.c_str()); + entry.AudioEventTreadGravel = tableData.getStringField(92, std::string{}.c_str()); + entry.AudioEventTreadMud = tableData.getStringField(93, std::string{}.c_str()); + entry.AudioEventTreadWater = tableData.getStringField(94, std::string{}.c_str()); + entry.AudioEventTreadSnow = tableData.getStringField(95, std::string{}.c_str()); + entry.AudioEventTreadIce = tableData.getStringField(96, std::string{}.c_str()); + entry.AudioEventTreadMetal = tableData.getStringField(97, std::string{}.c_str()); + entry.AudioEventTreadLeaves = tableData.getStringField(98, std::string{}.c_str()); + entry.AudioEventLightLand = tableData.getStringField(99, std::string{}.c_str()); + entry.AudioAirtimeForLightLand = tableData.getFloatField(100, float{}); + entry.AudioEventHeavyLand = tableData.getStringField(101, std::string{}.c_str()); + entry.AudioAirtimeForHeavyLand = tableData.getFloatField(102, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDVehiclePhysicsTable::~CDVehiclePhysicsTable() { +} + +std::string CDVehiclePhysicsTable::GetName(void) const { + return "VehiclePhysics"; +} + +std::vector CDVehiclePhysicsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDVehiclePhysicsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDVehiclePhysicsTable.h b/dDatabase/Tables/CDVehiclePhysicsTable.h new file mode 100644 index 0000000..a436b45 --- /dev/null +++ b/dDatabase/Tables/CDVehiclePhysicsTable.h @@ -0,0 +1,123 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.467578 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDVehiclePhysics { + int id; + std::string name; + std::string hkxFilename; + float fGravityScale; + float fMass; + float fChassisFriction; + float fMaxSpeed; + float fEngineTorque; + float fBrakeFrontTorque; + float fBrakeRearTorque; + float fBrakeMinInputToBlock; + float fBrakeMinTimeToBlock; + float fSteeringMaxAngle; + float fSteeringSpeedLimitForMaxAngle; + float fSteeringMinAngle; + float fFwdBias; + float fFrontTireFriction; + float fRearTireFriction; + float fFrontTireFrictionSlide; + float fRearTireFrictionSlide; + float fFrontTireSlipAngle; + float fRearTireSlipAngle; + float fWheelWidth; + float fWheelRadius; + float fWheelMass; + float fReorientPitchStrength; + float fReorientRollStrength; + float fSuspensionLength; + float fSuspensionStrength; + float fSuspensionDampingCompression; + float fSuspensionDampingRelaxation; + int iChassisCollisionGroup; + float fNormalSpinDamping; + float fCollisionSpinDamping; + float fCollisionThreshold; + float fTorqueRollFactor; + float fTorquePitchFactor; + float fTorqueYawFactor; + float fInertiaRoll; + float fInertiaPitch; + float fInertiaYaw; + float fExtraTorqueFactor; + float fCenterOfMassFwd; + float fCenterOfMassUp; + float fCenterOfMassRight; + float fWheelHardpointFrontFwd; + float fWheelHardpointFrontUp; + float fWheelHardpointFrontRight; + float fWheelHardpointRearFwd; + float fWheelHardpointRearUp; + float fWheelHardpointRearRight; + float fInputTurnSpeed; + float fInputDeadTurnBackSpeed; + float fInputAccelSpeed; + float fInputDeadAccelDownSpeed; + float fInputDecelSpeed; + float fInputDeadDecelDownSpeed; + float fInputSlopeChangePointX; + float fInputInitialSlope; + float fInputDeadZone; + float fAeroAirDensity; + float fAeroFrontalArea; + float fAeroDragCoefficient; + float fAeroLiftCoefficient; + float fAeroExtraGravity; + float fBoostTopSpeed; + float fBoostCostPerSecond; + float fBoostAccelerateChange; + float fBoostDampingChange; + float fPowerslideNeutralAngle; + float fPowerslideTorqueStrength; + int iPowerslideNumTorqueApplications; + float fImaginationTankSize; + float fSkillCost; + float fWreckSpeedBase; + float fWreckSpeedPercent; + float fWreckMinAngle; + std::string AudioEventEngine; + std::string AudioEventSkid; + std::string AudioEventLightHit; + float AudioSpeedThresholdLightHit; + float AudioTimeoutLightHit; + std::string AudioEventHeavyHit; + float AudioSpeedThresholdHeavyHit; + float AudioTimeoutHeavyHit; + std::string AudioEventStart; + std::string AudioEventTreadConcrete; + std::string AudioEventTreadSand; + std::string AudioEventTreadWood; + std::string AudioEventTreadDirt; + std::string AudioEventTreadPlastic; + std::string AudioEventTreadGrass; + std::string AudioEventTreadGravel; + std::string AudioEventTreadMud; + std::string AudioEventTreadWater; + std::string AudioEventTreadSnow; + std::string AudioEventTreadIce; + std::string AudioEventTreadMetal; + std::string AudioEventTreadLeaves; + std::string AudioEventLightLand; + float AudioAirtimeForLightLand; + std::string AudioEventHeavyLand; + float AudioAirtimeForHeavyLand; +}; + +class CDVehiclePhysicsTable : public CDTable { +private: + std::vector m_entries; +public: + CDVehiclePhysicsTable(); + ~CDVehiclePhysicsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDVehicleStatMapTable.cpp b/dDatabase/Tables/CDVehicleStatMapTable.cpp new file mode 100644 index 0000000..ec00b6e --- /dev/null +++ b/dDatabase/Tables/CDVehicleStatMapTable.cpp @@ -0,0 +1,47 @@ +#include "CDVehicleStatMapTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.486777 +//DO NOT EDIT THIS FILE MANUALLY! + +CDVehicleStatMapTable::CDVehicleStatMapTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM VehicleStatMap"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VehicleStatMap"); + while (!tableData.eof()) { + CDVehicleStatMap entry; + entry.id = tableData.getIntField(0, int{}); + entry.ModuleStat = tableData.getStringField(1, std::string{}.c_str()); + entry.HavokStat = tableData.getStringField(2, std::string{}.c_str()); + entry.HavokChangePerModuleStat = tableData.getFloatField(3, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDVehicleStatMapTable::~CDVehicleStatMapTable() { +} + +std::string CDVehicleStatMapTable::GetName(void) const { + return "VehicleStatMap"; +} + +std::vector CDVehicleStatMapTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDVehicleStatMapTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDVehicleStatMapTable.h b/dDatabase/Tables/CDVehicleStatMapTable.h new file mode 100644 index 0000000..aa22f01 --- /dev/null +++ b/dDatabase/Tables/CDVehicleStatMapTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.482537 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDVehicleStatMap { + int id; + std::string ModuleStat; + std::string HavokStat; + float HavokChangePerModuleStat; +}; + +class CDVehicleStatMapTable : public CDTable { +private: + std::vector m_entries; +public: + CDVehicleStatMapTable(); + ~CDVehicleStatMapTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDVendorComponentTable.cpp b/dDatabase/Tables/CDVendorComponentTable.cpp index e096e85..77b0c66 100644 --- a/dDatabase/Tables/CDVendorComponentTable.cpp +++ b/dDatabase/Tables/CDVendorComponentTable.cpp @@ -1,58 +1,48 @@ #include "CDVendorComponentTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.492515 +//DO NOT EDIT THIS FILE MANUALLY! -//! Constructor -CDVendorComponentTable::CDVendorComponentTable(void) { - - // First, get the size of the table +CDVendorComponentTable::CDVendorComponentTable() { unsigned int size = 0; auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM VendorComponent"); - while (!tableSize.eof()) { + while (!tableSize.eof()) { size = tableSize.getIntField(0, 0); - tableSize.nextRow(); } - - tableSize.finalize(); - - // Reserve the size - this->entries.reserve(size); - // Now get the data + tableSize.finalize(); + this->m_entries.reserve(size); + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM VendorComponent"); while (!tableData.eof()) { CDVendorComponent entry; - entry.id = tableData.getIntField(0, -1); - entry.buyScalar = tableData.getFloatField(1, -1.0f); - entry.sellScalar = tableData.getFloatField(2, -1.0f); - entry.refreshTimeSeconds = tableData.getFloatField(3, -1.0f); - entry.LootMatrixIndex = tableData.getIntField(4, -1); - - this->entries.push_back(entry); + entry.id = tableData.getIntField(0, int{}); + entry.buyScalar = tableData.getFloatField(1, float{}); + entry.sellScalar = tableData.getFloatField(2, float{}); + entry.refreshTimeSeconds = tableData.getFloatField(3, float{}); + entry.LootMatrixIndex = tableData.getIntField(4, int{}); + this->m_entries.push_back(entry); tableData.nextRow(); } tableData.finalize(); } -//! Destructor -CDVendorComponentTable::~CDVendorComponentTable(void) { } +CDVendorComponentTable::~CDVendorComponentTable() { +} -//! Returns the table's name std::string CDVendorComponentTable::GetName(void) const { return "VendorComponent"; } -//! Queries the table with a custom "where" clause std::vector CDVendorComponentTable::Query(std::function predicate) { - - std::vector data = cpplinq::from(this->entries) + std::vector data = cpplinq::from(this->m_entries) >> cpplinq::where(predicate) >> cpplinq::to_vector(); return data; } -//! Gets all the entries in the table std::vector CDVendorComponentTable::GetEntries(void) const { - return this->entries; + return this->m_entries; } diff --git a/dDatabase/Tables/CDVendorComponentTable.h b/dDatabase/Tables/CDVendorComponentTable.h index 2e0fb9e..b61aed6 100644 --- a/dDatabase/Tables/CDVendorComponentTable.h +++ b/dDatabase/Tables/CDVendorComponentTable.h @@ -1,52 +1,25 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDVendorComponentTable.hpp - \brief Contains data for the VendorComponent table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.490518 +//DO NOT EDIT THIS FILE MANUALLY! - //! VendorComponent Struct struct CDVendorComponent { - unsigned int id; //!< The Component ID - float buyScalar; //!< Buy Scalar (what does that mean?) - float sellScalar; //!< Sell Scalar (what does that mean?) - float refreshTimeSeconds; //!< The refresh time - unsigned int LootMatrixIndex; //!< LootMatrixIndex of the vendor's items + int id; + float buyScalar; + float sellScalar; + float refreshTimeSeconds; + int LootMatrixIndex; }; -//! VendorComponent table class CDVendorComponentTable : public CDTable { private: - std::vector entries; - + std::vector m_entries; public: - - //! Constructor - CDVendorComponentTable(void); - - //! Destructor - ~CDVendorComponentTable(void); - - //! Returns the table's name - /*! - \return The table name - */ + CDVendorComponentTable(); + ~CDVendorComponentTable(); std::string GetName(void) const override; - //! Queries the table with a custom "where" clause - /*! - \param predicate The predicate - */ - std::vector Query(std::function predicate); - - //! Gets all the entries in the table - /*! - \return The entries - */ +std::vector Query(std::function predicate); std::vector GetEntries(void) const; - }; - diff --git a/dDatabase/Tables/CDWorldConfigTable.cpp b/dDatabase/Tables/CDWorldConfigTable.cpp new file mode 100644 index 0000000..3368e8e --- /dev/null +++ b/dDatabase/Tables/CDWorldConfigTable.cpp @@ -0,0 +1,92 @@ +#include "CDWorldConfigTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.497531 +//DO NOT EDIT THIS FILE MANUALLY! + +CDWorldConfigTable::CDWorldConfigTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM WorldConfig"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM WorldConfig"); + while (!tableData.eof()) { + CDWorldConfig entry; + entry.pegravityvalue = tableData.getFloatField(0, float{}); + entry.pebroadphaseworldsize = tableData.getFloatField(1, float{}); + entry.pegameobjscalefactor = tableData.getFloatField(2, float{}); + entry.character_rotation_speed = tableData.getFloatField(3, float{}); + entry.character_walk_forward_speed = tableData.getFloatField(4, float{}); + entry.character_walk_backward_speed = tableData.getFloatField(5, float{}); + entry.character_walk_strafe_speed = tableData.getFloatField(6, float{}); + entry.character_walk_strafe_forward_speed = tableData.getFloatField(7, float{}); + entry.character_walk_strafe_backward_speed = tableData.getFloatField(8, float{}); + entry.character_run_backward_speed = tableData.getFloatField(9, float{}); + entry.character_run_strafe_speed = tableData.getFloatField(10, float{}); + entry.character_run_strafe_forward_speed = tableData.getFloatField(11, float{}); + entry.character_run_strafe_backward_speed = tableData.getFloatField(12, float{}); + entry.global_cooldown = tableData.getFloatField(13, float{}); + entry.characterGroundedTime = tableData.getFloatField(14, float{}); + entry.characterGroundedSpeed = tableData.getFloatField(15, float{}); + entry.globalImmunityTime = tableData.getFloatField(16, float{}); + entry.character_max_slope = tableData.getFloatField(17, float{}); + entry.defaultrespawntime = tableData.getFloatField(18, float{}); + entry.mission_tooltip_timeout = tableData.getFloatField(19, float{}); + entry.vendor_buy_multiplier = tableData.getFloatField(20, float{}); + entry.pet_follow_radius = tableData.getFloatField(21, float{}); + entry.character_eye_height = tableData.getFloatField(22, float{}); + entry.flight_vertical_velocity = tableData.getFloatField(23, float{}); + entry.flight_airspeed = tableData.getFloatField(24, float{}); + entry.flight_fuel_ratio = tableData.getFloatField(25, float{}); + entry.flight_max_airspeed = tableData.getFloatField(26, float{}); + entry.fReputationPerVote = tableData.getFloatField(27, float{}); + entry.nPropertyCloneLimit = tableData.getIntField(28, int{}); + entry.defaultHomespaceTemplate = tableData.getIntField(29, int{}); + entry.coins_lost_on_death_percent = tableData.getFloatField(30, float{}); + entry.coins_lost_on_death_min = tableData.getIntField(31, int{}); + entry.coins_lost_on_death_max = tableData.getIntField(32, int{}); + entry.character_votes_per_day = tableData.getIntField(33, int{}); + entry.property_moderation_request_approval_cost = tableData.getIntField(34, int{}); + entry.property_moderation_request_review_cost = tableData.getIntField(35, int{}); + entry.propertyModRequestsAllowedSpike = tableData.getIntField(36, int{}); + entry.propertyModRequestsAllowedInterval = tableData.getIntField(37, int{}); + entry.propertyModRequestsAllowedTotal = tableData.getIntField(38, int{}); + entry.propertyModRequestsSpikeDuration = tableData.getIntField(39, int{}); + entry.propertyModRequestsIntervalDuration = tableData.getIntField(40, int{}); + entry.modelModerateOnCreate = tableData.getIntField(41, bool{}); + entry.defaultPropertyMaxHeight = tableData.getFloatField(42, float{}); + entry.reputationPerVoteCast = tableData.getFloatField(43, float{}); + entry.reputationPerVoteReceived = tableData.getFloatField(44, float{}); + entry.showcaseTopModelConsiderationBattles = tableData.getIntField(45, int{}); + entry.reputationPerBattlePromotion = tableData.getFloatField(46, float{}); + entry.coins_lost_on_death_min_timeout = tableData.getFloatField(47, float{}); + entry.coins_lost_on_death_max_timeout = tableData.getFloatField(48, float{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDWorldConfigTable::~CDWorldConfigTable() { +} + +std::string CDWorldConfigTable::GetName(void) const { + return "WorldConfig"; +} + +std::vector CDWorldConfigTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDWorldConfigTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDWorldConfigTable.h b/dDatabase/Tables/CDWorldConfigTable.h new file mode 100644 index 0000000..964e849 --- /dev/null +++ b/dDatabase/Tables/CDWorldConfigTable.h @@ -0,0 +1,69 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.495647 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDWorldConfig { + float pegravityvalue; + float pebroadphaseworldsize; + float pegameobjscalefactor; + float character_rotation_speed; + float character_walk_forward_speed; + float character_walk_backward_speed; + float character_walk_strafe_speed; + float character_walk_strafe_forward_speed; + float character_walk_strafe_backward_speed; + float character_run_backward_speed; + float character_run_strafe_speed; + float character_run_strafe_forward_speed; + float character_run_strafe_backward_speed; + float global_cooldown; + float characterGroundedTime; + float characterGroundedSpeed; + float globalImmunityTime; + float character_max_slope; + float defaultrespawntime; + float mission_tooltip_timeout; + float vendor_buy_multiplier; + float pet_follow_radius; + float character_eye_height; + float flight_vertical_velocity; + float flight_airspeed; + float flight_fuel_ratio; + float flight_max_airspeed; + float fReputationPerVote; + int nPropertyCloneLimit; + int defaultHomespaceTemplate; + float coins_lost_on_death_percent; + int coins_lost_on_death_min; + int coins_lost_on_death_max; + int character_votes_per_day; + int property_moderation_request_approval_cost; + int property_moderation_request_review_cost; + int propertyModRequestsAllowedSpike; + int propertyModRequestsAllowedInterval; + int propertyModRequestsAllowedTotal; + int propertyModRequestsSpikeDuration; + int propertyModRequestsIntervalDuration; + bool modelModerateOnCreate; + float defaultPropertyMaxHeight; + float reputationPerVoteCast; + float reputationPerVoteReceived; + int showcaseTopModelConsiderationBattles; + float reputationPerBattlePromotion; + float coins_lost_on_death_min_timeout; + float coins_lost_on_death_max_timeout; +}; + +class CDWorldConfigTable : public CDTable { +private: + std::vector m_entries; +public: + CDWorldConfigTable(); + ~CDWorldConfigTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDZoneSummaryTable.cpp b/dDatabase/Tables/CDZoneSummaryTable.cpp new file mode 100644 index 0000000..396c5e2 --- /dev/null +++ b/dDatabase/Tables/CDZoneSummaryTable.cpp @@ -0,0 +1,47 @@ +#include "CDZoneSummaryTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.503482 +//DO NOT EDIT THIS FILE MANUALLY! + +CDZoneSummaryTable::CDZoneSummaryTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ZoneSummary"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ZoneSummary"); + while (!tableData.eof()) { + CDZoneSummary entry; + entry.zoneID = tableData.getIntField(0, int{}); + entry.type = tableData.getIntField(1, int{}); + entry.value = tableData.getIntField(2, int{}); + entry._uniqueID = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDZoneSummaryTable::~CDZoneSummaryTable() { +} + +std::string CDZoneSummaryTable::GetName(void) const { + return "ZoneSummary"; +} + +std::vector CDZoneSummaryTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDZoneSummaryTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDZoneSummaryTable.h b/dDatabase/Tables/CDZoneSummaryTable.h new file mode 100644 index 0000000..e3833c9 --- /dev/null +++ b/dDatabase/Tables/CDZoneSummaryTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.501487 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDZoneSummary { + int zoneID; + int type; + int value; + int _uniqueID; +}; + +class CDZoneSummaryTable : public CDTable { +private: + std::vector m_entries; +public: + CDZoneSummaryTable(); + ~CDZoneSummaryTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDZoneTableTable.cpp b/dDatabase/Tables/CDZoneTableTable.cpp index 7cd8d0d..1e32866 100644 --- a/dDatabase/Tables/CDZoneTableTable.cpp +++ b/dDatabase/Tables/CDZoneTableTable.cpp @@ -1,74 +1,57 @@ #include "CDZoneTableTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.508469 +//DO NOT EDIT THIS FILE MANUALLY! + +CDZoneTableTable::CDZoneTableTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ZoneTable"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } -//! Constructor -CDZoneTableTable::CDZoneTableTable(void) { - - // First, get the size of the table - unsigned int size = 0; - auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM ZoneTable"); - while (!tableSize.eof()) { - size = tableSize.getIntField(0, 0); - - tableSize.nextRow(); - } - tableSize.finalize(); - - // Now get the data - auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ZoneTable"); - while (!tableData.eof()) { - CDZoneTable entry; - entry.zoneID = tableData.getIntField(0, -1); - entry.locStatus = tableData.getIntField(1, -1); - entry.zoneName = tableData.getStringField(2, ""); - entry.scriptID = tableData.getIntField(3, -1); - entry.ghostdistance_min = tableData.getFloatField(4, -1.0f); - entry.ghostdistance = tableData.getFloatField(5, -1.0f); - entry.population_soft_cap = tableData.getIntField(6, -1); - entry.population_hard_cap = tableData.getIntField(7, -1); - UNUSED(entry.DisplayDescription = tableData.getStringField(8, "")); - UNUSED(entry.mapFolder = tableData.getStringField(9, "")); - entry.smashableMinDistance = tableData.getFloatField(10, -1.0f); - entry.smashableMaxDistance = tableData.getFloatField(11, -1.0f); - UNUSED(entry.mixerProgram = tableData.getStringField(12, "")); - UNUSED(entry.clientPhysicsFramerate = tableData.getStringField(13, "")); - UNUSED(entry.serverPhysicsFramerate = tableData.getStringField(14, "")); - entry.zoneControlTemplate = tableData.getIntField(15, -1); - entry.widthInChunks = tableData.getIntField(16, -1); - entry.heightInChunks = tableData.getIntField(17, -1); - entry.petsAllowed = tableData.getIntField(18, -1) == 1 ? true : false; - entry.localize = tableData.getIntField(19, -1) == 1 ? true : false; - entry.fZoneWeight = tableData.getFloatField(20, -1.0f); - UNUSED(entry.thumbnail = tableData.getStringField(21, "")); - entry.PlayerLoseCoinsOnDeath = tableData.getIntField(22, -1) == 1 ? true : false; - UNUSED(entry.disableSaveLoc = tableData.getIntField(23, -1) == 1 ? true : false); - entry.teamRadius = tableData.getFloatField(24, -1.0f); - UNUSED(entry.gate_version = tableData.getStringField(25, "")); - UNUSED(entry.mountsAllowed = tableData.getIntField(26, -1) == 1 ? true : false); - - this->m_Entries.insert(std::make_pair(entry.zoneID, entry)); - tableData.nextRow(); - } + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM ZoneTable"); + while (!tableData.eof()) { + CDZoneTable entry; + entry.zoneID = tableData.getIntField(0, int{}); + entry.zoneName = tableData.getStringField(1, std::string{}.c_str()); + entry.scriptID = tableData.getIntField(2, int{}); + entry.ghostdistance = tableData.getFloatField(3, float{}); + entry.population_soft_cap = tableData.getIntField(4, int{}); + entry.population_hard_cap = tableData.getIntField(5, int{}); + entry.DisplayDescription = tableData.getStringField(6, std::string{}.c_str()); + entry.mapFolder = tableData.getStringField(7, std::string{}.c_str()); + entry.smashableMinDistance = tableData.getFloatField(8, float{}); + entry.smashableMaxDistance = tableData.getFloatField(9, float{}); + entry.mixerProgram = tableData.getStringField(10, std::string{}.c_str()); + entry.clientPhysicsFramerate = tableData.getStringField(11, std::string{}.c_str()); + entry.serverPhysicsFramerate = tableData.getStringField(12, std::string{}.c_str()); + entry.zoneControlTemplate = tableData.getIntField(13, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } tableData.finalize(); } -//! Destructor -CDZoneTableTable::~CDZoneTableTable(void) { } - -//! Returns the table's name -std::string CDZoneTableTable::GetName(void) const { - return "ZoneTable"; +CDZoneTableTable::~CDZoneTableTable() { } -//! Queries the table with a zoneID to find. -const CDZoneTable* CDZoneTableTable::Query(unsigned int zoneID) { - const auto& iter = m_Entries.find(zoneID); +std::string CDZoneTableTable::GetName(void) const { + return "ZoneTable"; +} - if (iter != m_Entries.end()) - { - return &iter->second; - } +std::vector CDZoneTableTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); - return nullptr; -} \ No newline at end of file + return data; +} + +std::vector CDZoneTableTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDZoneTableTable.h b/dDatabase/Tables/CDZoneTableTable.h index f99febc..6302a1d 100644 --- a/dDatabase/Tables/CDZoneTableTable.h +++ b/dDatabase/Tables/CDZoneTableTable.h @@ -1,66 +1,34 @@ #pragma once - -// Custom Classes #include "CDTable.h" -/*! - \file CDZoneTableTable.hpp - \brief Contains data for the ZoneTable table - */ +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.507471 +//DO NOT EDIT THIS FILE MANUALLY! -//! ZoneTable Struct struct CDZoneTable { - unsigned int zoneID; //!< The Zone ID of the object - unsigned int locStatus; //!< The Locale Status(?) - std::string zoneName; //!< The name of the zone - unsigned int scriptID; //!< The Script ID of the zone (ScriptsTable) - float ghostdistance_min; //!< The minimum ghosting distance - float ghostdistance; //!< The ghosting distance - unsigned int population_soft_cap; //!< The "soft cap" on the world population - unsigned int population_hard_cap; //!< The "hard cap" on the world population - UNUSED(std::string DisplayDescription); //!< The display description of the world - UNUSED(std::string mapFolder); //!< ??? - float smashableMinDistance; //!< The minimum smashable distance? - float smashableMaxDistance; //!< The maximum smashable distance? - UNUSED(std::string mixerProgram); //!< ??? - UNUSED(std::string clientPhysicsFramerate); //!< The client physics framerate - UNUSED(std::string serverPhysicsFramerate); //!< The server physics framerate - unsigned int zoneControlTemplate; //!< The Zone Control template - unsigned int widthInChunks; //!< The width of the world in chunks - unsigned int heightInChunks; //!< The height of the world in chunks - bool petsAllowed; //!< Whether or not pets are allowed in the world - bool localize; //!< Whether or not the world should be localized - float fZoneWeight; //!< ??? - UNUSED(std::string thumbnail); //!< The thumbnail of the world - bool PlayerLoseCoinsOnDeath; //!< Whether or not the user loses coins on death - UNUSED(bool disableSaveLoc); //!< Disables the saving location? - float teamRadius; //!< ??? - UNUSED(std::string gate_version); //!< The gate version - UNUSED(bool mountsAllowed); //!< Whether or not mounts are allowed + int zoneID; + std::string zoneName; + int scriptID; + float ghostdistance; + int population_soft_cap; + int population_hard_cap; + std::string DisplayDescription; + std::string mapFolder; + float smashableMinDistance; + float smashableMaxDistance; + std::string mixerProgram; + std::string clientPhysicsFramerate; + std::string serverPhysicsFramerate; + int zoneControlTemplate; }; -//! ZoneTable table class CDZoneTableTable : public CDTable { private: - std::map m_Entries; - + std::vector m_entries; public: - - //! Constructor - CDZoneTableTable(void); - - //! Destructor - ~CDZoneTableTable(void); - - //! Returns the table's name - /*! - \return The table name - */ - std::string GetName(void) const override; - - //! Queries the table with a zoneID to find. - /*! - \param id The zoneID - */ - const CDZoneTable* Query(unsigned int zoneID); -}; \ No newline at end of file + CDZoneTableTable(); + ~CDZoneTableTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDbrickAttributesTable.cpp b/dDatabase/Tables/CDbrickAttributesTable.cpp new file mode 100644 index 0000000..9318a6e --- /dev/null +++ b/dDatabase/Tables/CDbrickAttributesTable.cpp @@ -0,0 +1,46 @@ +#include "CDbrickAttributesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.898117 +//DO NOT EDIT THIS FILE MANUALLY! + +CDbrickAttributesTable::CDbrickAttributesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM brickAttributes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM brickAttributes"); + while (!tableData.eof()) { + CDbrickAttributes entry; + entry.ID = tableData.getIntField(0, int{}); + entry.name = tableData.getStringField(1, std::string{}.c_str()); + entry.icon_asset = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDbrickAttributesTable::~CDbrickAttributesTable() { +} + +std::string CDbrickAttributesTable::GetName(void) const { + return "brickAttributes"; +} + +std::vector CDbrickAttributesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDbrickAttributesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDbrickAttributesTable.h b/dDatabase/Tables/CDbrickAttributesTable.h new file mode 100644 index 0000000..7c1cf8c --- /dev/null +++ b/dDatabase/Tables/CDbrickAttributesTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.896104 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDbrickAttributes { + int ID; + std::string name; + std::string icon_asset; +}; + +class CDbrickAttributesTable : public CDTable { +private: + std::vector m_entries; +public: + CDbrickAttributesTable(); + ~CDbrickAttributesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDdtpropertiesTable.cpp b/dDatabase/Tables/CDdtpropertiesTable.cpp new file mode 100644 index 0000000..d3e0e9c --- /dev/null +++ b/dDatabase/Tables/CDdtpropertiesTable.cpp @@ -0,0 +1,50 @@ +#include "CDdtpropertiesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.965918 +//DO NOT EDIT THIS FILE MANUALLY! + +CDdtpropertiesTable::CDdtpropertiesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM dtproperties"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM dtproperties"); + while (!tableData.eof()) { + CDdtproperties entry; + entry.id = tableData.getIntField(0, int{}); + entry.objectid = tableData.getIntField(1, int{}); + entry.property = tableData.getStringField(2, std::string{}.c_str()); + entry.value = tableData.getStringField(3, std::string{}.c_str()); + entry.uvalue = tableData.getStringField(4, std::string{}.c_str()); + //entry.lvalue = tableData.getimageField(5, image{}); //what? + entry.version = tableData.getIntField(6, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDdtpropertiesTable::~CDdtpropertiesTable() { +} + +std::string CDdtpropertiesTable::GetName(void) const { + return "dtproperties"; +} + +std::vector CDdtpropertiesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDdtpropertiesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDdtpropertiesTable.h b/dDatabase/Tables/CDdtpropertiesTable.h new file mode 100644 index 0000000..668b49c --- /dev/null +++ b/dDatabase/Tables/CDdtpropertiesTable.h @@ -0,0 +1,27 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:32.964921 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDdtproperties { + int id; + int objectid; + std::string property; + std::string value; + std::string uvalue; + //image lvalue; + int version; +}; + +class CDdtpropertiesTable : public CDTable { +private: + std::vector m_entries; +public: + CDdtpropertiesTable(); + ~CDdtpropertiesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapAssetTypeTable.cpp b/dDatabase/Tables/CDmapAssetTypeTable.cpp new file mode 100644 index 0000000..6f75b9a --- /dev/null +++ b/dDatabase/Tables/CDmapAssetTypeTable.cpp @@ -0,0 +1,47 @@ +#include "CDmapAssetTypeTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.140655 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapAssetTypeTable::CDmapAssetTypeTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapAssetType"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapAssetType"); + while (!tableData.eof()) { + CDmapAssetType entry; + entry.id = tableData.getIntField(0, int{}); + entry.label = tableData.getStringField(1, std::string{}.c_str()); + entry.pathdir = tableData.getStringField(2, std::string{}.c_str()); + entry.typelabel = tableData.getStringField(3, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapAssetTypeTable::~CDmapAssetTypeTable() { +} + +std::string CDmapAssetTypeTable::GetName(void) const { + return "mapAssetType"; +} + +std::vector CDmapAssetTypeTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapAssetTypeTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapAssetTypeTable.h b/dDatabase/Tables/CDmapAssetTypeTable.h new file mode 100644 index 0000000..3cea4f5 --- /dev/null +++ b/dDatabase/Tables/CDmapAssetTypeTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.139455 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapAssetType { + int id; + std::string label; + std::string pathdir; + std::string typelabel; +}; + +class CDmapAssetTypeTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapAssetTypeTable(); + ~CDmapAssetTypeTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapComponentTypeTable.cpp b/dDatabase/Tables/CDmapComponentTypeTable.cpp new file mode 100644 index 0000000..131179c --- /dev/null +++ b/dDatabase/Tables/CDmapComponentTypeTable.cpp @@ -0,0 +1,46 @@ +#include "CDmapComponentTypeTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.151422 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapComponentTypeTable::CDmapComponentTypeTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapComponentType"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapComponentType"); + while (!tableData.eof()) { + CDmapComponentType entry; + entry.id = tableData.getIntField(0, int{}); + entry.label = tableData.getStringField(1, std::string{}.c_str()); + entry.table = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapComponentTypeTable::~CDmapComponentTypeTable() { +} + +std::string CDmapComponentTypeTable::GetName(void) const { + return "mapComponentType"; +} + +std::vector CDmapComponentTypeTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapComponentTypeTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapComponentTypeTable.h b/dDatabase/Tables/CDmapComponentTypeTable.h new file mode 100644 index 0000000..b387c9f --- /dev/null +++ b/dDatabase/Tables/CDmapComponentTypeTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.149428 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapComponentType { + int id; + std::string label; + std::string table; +}; + +class CDmapComponentTypeTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapComponentTypeTable(); + ~CDmapComponentTypeTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapIconTable.cpp b/dDatabase/Tables/CDmapIconTable.cpp new file mode 100644 index 0000000..711bebd --- /dev/null +++ b/dDatabase/Tables/CDmapIconTable.cpp @@ -0,0 +1,46 @@ +#include "CDmapIconTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.157738 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapIconTable::CDmapIconTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapIcon"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapIcon"); + while (!tableData.eof()) { + CDmapIcon entry; + entry.LOT = tableData.getIntField(0, int{}); + entry.iconID = tableData.getIntField(1, int{}); + entry.iconState = tableData.getIntField(2, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapIconTable::~CDmapIconTable() { +} + +std::string CDmapIconTable::GetName(void) const { + return "mapIcon"; +} + +std::vector CDmapIconTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapIconTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapIconTable.h b/dDatabase/Tables/CDmapIconTable.h new file mode 100644 index 0000000..c2c419e --- /dev/null +++ b/dDatabase/Tables/CDmapIconTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.155412 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapIcon { + int LOT; + int iconID; + int iconState; +}; + +class CDmapIconTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapIconTable(); + ~CDmapIconTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapItemTypesTable.cpp b/dDatabase/Tables/CDmapItemTypesTable.cpp new file mode 100644 index 0000000..4221f84 --- /dev/null +++ b/dDatabase/Tables/CDmapItemTypesTable.cpp @@ -0,0 +1,46 @@ +#include "CDmapItemTypesTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.164879 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapItemTypesTable::CDmapItemTypesTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapItemTypes"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapItemTypes"); + while (!tableData.eof()) { + CDmapItemTypes entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.equipLocation = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapItemTypesTable::~CDmapItemTypesTable() { +} + +std::string CDmapItemTypesTable::GetName(void) const { + return "mapItemTypes"; +} + +std::vector CDmapItemTypesTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapItemTypesTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapItemTypesTable.h b/dDatabase/Tables/CDmapItemTypesTable.h new file mode 100644 index 0000000..89fa345 --- /dev/null +++ b/dDatabase/Tables/CDmapItemTypesTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.162393 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapItemTypes { + int id; + std::string description; + std::string equipLocation; +}; + +class CDmapItemTypesTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapItemTypesTable(); + ~CDmapItemTypesTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapRenderEffectsTable.cpp b/dDatabase/Tables/CDmapRenderEffectsTable.cpp new file mode 100644 index 0000000..f15f382 --- /dev/null +++ b/dDatabase/Tables/CDmapRenderEffectsTable.cpp @@ -0,0 +1,46 @@ +#include "CDmapRenderEffectsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.169829 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapRenderEffectsTable::CDmapRenderEffectsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapRenderEffects"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapRenderEffects"); + while (!tableData.eof()) { + CDmapRenderEffects entry; + entry.id = tableData.getIntField(0, int{}); + entry.gameID = tableData.getIntField(1, int{}); + entry.description = tableData.getStringField(2, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapRenderEffectsTable::~CDmapRenderEffectsTable() { +} + +std::string CDmapRenderEffectsTable::GetName(void) const { + return "mapRenderEffects"; +} + +std::vector CDmapRenderEffectsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapRenderEffectsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapRenderEffectsTable.h b/dDatabase/Tables/CDmapRenderEffectsTable.h new file mode 100644 index 0000000..aa7bb42 --- /dev/null +++ b/dDatabase/Tables/CDmapRenderEffectsTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.167380 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapRenderEffects { + int id; + int gameID; + std::string description; +}; + +class CDmapRenderEffectsTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapRenderEffectsTable(); + ~CDmapRenderEffectsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapShadersTable.cpp b/dDatabase/Tables/CDmapShadersTable.cpp new file mode 100644 index 0000000..ae0cfab --- /dev/null +++ b/dDatabase/Tables/CDmapShadersTable.cpp @@ -0,0 +1,47 @@ +#include "CDmapShadersTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.179416 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapShadersTable::CDmapShadersTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapShaders"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapShaders"); + while (!tableData.eof()) { + CDmapShaders entry; + entry.id = tableData.getIntField(0, int{}); + entry.label = tableData.getStringField(1, std::string{}.c_str()); + entry.gameValue = tableData.getIntField(2, int{}); + entry.priority = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapShadersTable::~CDmapShadersTable() { +} + +std::string CDmapShadersTable::GetName(void) const { + return "mapShaders"; +} + +std::vector CDmapShadersTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapShadersTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapShadersTable.h b/dDatabase/Tables/CDmapShadersTable.h new file mode 100644 index 0000000..a620fc8 --- /dev/null +++ b/dDatabase/Tables/CDmapShadersTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.174362 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapShaders { + int id; + std::string label; + int gameValue; + int priority; +}; + +class CDmapShadersTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapShadersTable(); + ~CDmapShadersTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmapTextureResourceTable.cpp b/dDatabase/Tables/CDmapTextureResourceTable.cpp new file mode 100644 index 0000000..b158917 --- /dev/null +++ b/dDatabase/Tables/CDmapTextureResourceTable.cpp @@ -0,0 +1,47 @@ +#include "CDmapTextureResourceTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.182341 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmapTextureResourceTable::CDmapTextureResourceTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM mapTextureResource"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM mapTextureResource"); + while (!tableData.eof()) { + CDmapTextureResource entry; + entry.id = tableData.getIntField(0, int{}); + entry.texturepath = tableData.getStringField(1, std::string{}.c_str()); + entry.soundtype = tableData.getStringField(2, std::string{}.c_str()); + entry.SurfaceType = tableData.getIntField(3, int{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmapTextureResourceTable::~CDmapTextureResourceTable() { +} + +std::string CDmapTextureResourceTable::GetName(void) const { + return "mapTextureResource"; +} + +std::vector CDmapTextureResourceTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmapTextureResourceTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmapTextureResourceTable.h b/dDatabase/Tables/CDmapTextureResourceTable.h new file mode 100644 index 0000000..6ca99fb --- /dev/null +++ b/dDatabase/Tables/CDmapTextureResourceTable.h @@ -0,0 +1,24 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.181344 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmapTextureResource { + int id; + std::string texturepath; + std::string soundtype; + int SurfaceType; +}; + +class CDmapTextureResourceTable : public CDTable { +private: + std::vector m_entries; +public: + CDmapTextureResourceTable(); + ~CDmapTextureResourceTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDmap_BlueprintCategoryTable.cpp b/dDatabase/Tables/CDmap_BlueprintCategoryTable.cpp new file mode 100644 index 0000000..8df038d --- /dev/null +++ b/dDatabase/Tables/CDmap_BlueprintCategoryTable.cpp @@ -0,0 +1,46 @@ +#include "CDmap_BlueprintCategoryTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.135465 +//DO NOT EDIT THIS FILE MANUALLY! + +CDmap_BlueprintCategoryTable::CDmap_BlueprintCategoryTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM map_BlueprintCategory"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM map_BlueprintCategory"); + while (!tableData.eof()) { + CDmap_BlueprintCategory entry; + entry.id = tableData.getIntField(0, int{}); + entry.description = tableData.getStringField(1, std::string{}.c_str()); + entry.enabled = tableData.getIntField(2, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDmap_BlueprintCategoryTable::~CDmap_BlueprintCategoryTable() { +} + +std::string CDmap_BlueprintCategoryTable::GetName(void) const { + return "map_BlueprintCategory"; +} + +std::vector CDmap_BlueprintCategoryTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDmap_BlueprintCategoryTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDmap_BlueprintCategoryTable.h b/dDatabase/Tables/CDmap_BlueprintCategoryTable.h new file mode 100644 index 0000000..5fb323f --- /dev/null +++ b/dDatabase/Tables/CDmap_BlueprintCategoryTable.h @@ -0,0 +1,23 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.133471 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDmap_BlueprintCategory { + int id; + std::string description; + bool enabled; +}; + +class CDmap_BlueprintCategoryTable : public CDTable { +private: + std::vector m_entries; +public: + CDmap_BlueprintCategoryTable(); + ~CDmap_BlueprintCategoryTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDsysdiagramsTable.cpp b/dDatabase/Tables/CDsysdiagramsTable.cpp new file mode 100644 index 0000000..22d3605 --- /dev/null +++ b/dDatabase/Tables/CDsysdiagramsTable.cpp @@ -0,0 +1,48 @@ +#include "CDsysdiagramsTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.440655 +//DO NOT EDIT THIS FILE MANUALLY! + +CDsysdiagramsTable::CDsysdiagramsTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM sysdiagrams"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM sysdiagrams"); + while (!tableData.eof()) { + CDsysdiagrams entry; + entry.name = tableData.getStringField(0, std::string{}.c_str()); + entry.principal_id = tableData.getIntField(1, int{}); + entry.diagram_id = tableData.getIntField(2, int{}); + entry.version = tableData.getIntField(3, int{}); + //entry.definition = tableData.getvarbinaryField(4, varbinary{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDsysdiagramsTable::~CDsysdiagramsTable() { +} + +std::string CDsysdiagramsTable::GetName(void) const { + return "sysdiagrams"; +} + +std::vector CDsysdiagramsTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDsysdiagramsTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDsysdiagramsTable.h b/dDatabase/Tables/CDsysdiagramsTable.h new file mode 100644 index 0000000..2dd587d --- /dev/null +++ b/dDatabase/Tables/CDsysdiagramsTable.h @@ -0,0 +1,25 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.439652 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDsysdiagrams { + std::string name; + int principal_id; + int diagram_id; + int version; + //varbinary definition; +}; + +class CDsysdiagramsTable : public CDTable { +private: + std::vector m_entries; +public: + CDsysdiagramsTable(); + ~CDsysdiagramsTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDtestCharactersTable.cpp b/dDatabase/Tables/CDtestCharactersTable.cpp new file mode 100644 index 0000000..41d33ff --- /dev/null +++ b/dDatabase/Tables/CDtestCharactersTable.cpp @@ -0,0 +1,51 @@ +#include "CDtestCharactersTable.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.450630 +//DO NOT EDIT THIS FILE MANUALLY! + +CDtestCharactersTable::CDtestCharactersTable() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM testCharacters"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM testCharacters"); + while (!tableData.eof()) { + CDtestCharacters entry; + entry.id = tableData.getInt64Field(0, uint64_t{}); + entry.propertycloneid = tableData.getIntField(1, int{}); + entry.name = tableData.getStringField(2, std::string{}.c_str()); + entry.objid = tableData.getIntField(3, int{}); + entry.timestamp = tableData.getStringField(4, std::string{}.c_str()); + entry.online = tableData.getIntField(5, bool{}); + entry.pendingname = tableData.getStringField(6, std::string{}.c_str()); + entry.requiresrename = tableData.getIntField(7, bool{}); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDtestCharactersTable::~CDtestCharactersTable() { +} + +std::string CDtestCharactersTable::GetName(void) const { + return "testCharacters"; +} + +std::vector CDtestCharactersTable::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDtestCharactersTable::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDtestCharactersTable.h b/dDatabase/Tables/CDtestCharactersTable.h new file mode 100644 index 0000000..07166b8 --- /dev/null +++ b/dDatabase/Tables/CDtestCharactersTable.h @@ -0,0 +1,28 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.448654 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDtestCharacters { + uint64_t id; + int propertycloneid; + std::string name; + int objid; + std::string timestamp; + bool online; + std::string pendingname; + bool requiresrename; +}; + +class CDtestCharactersTable : public CDTable { +private: + std::vector m_entries; +public: + CDtestCharactersTable(); + ~CDtestCharactersTable(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +}; diff --git a/dDatabase/Tables/CDtesttable2Table.cpp b/dDatabase/Tables/CDtesttable2Table.cpp new file mode 100644 index 0000000..ef7b225 --- /dev/null +++ b/dDatabase/Tables/CDtesttable2Table.cpp @@ -0,0 +1,58 @@ +#include "CDtesttable2Table.h" +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.452620 +//DO NOT EDIT THIS FILE MANUALLY! + +CDtesttable2Table::CDtesttable2Table() { + unsigned int size = 0; + auto tableSize = CDClientDatabase::ExecuteQuery("SELECT COUNT(*) FROM testtable2"); + while (!tableSize.eof()) { + size = tableSize.getIntField(0, 0); + tableSize.nextRow(); + } + + tableSize.finalize(); + this->m_entries.reserve(size); + + auto tableData = CDClientDatabase::ExecuteQuery("SELECT * FROM testtable2"); + while (!tableData.eof()) { + CDtesttable2 entry; + entry.id = tableData.getIntField(0, int{}); + entry.realVal = tableData.getFloatField(1, float{}); + entry.varCharVal = tableData.getStringField(2, std::string{}.c_str()); + entry.intVal = tableData.getIntField(3, int{}); + entry.int64val = tableData.getInt64Field(4, uint64_t{}); + entry.bitVal = tableData.getIntField(5, bool{}); + entry.smallVal = tableData.getIntField(6, int{}); + entry.tinyVal = tableData.getIntField(7, int{}); + entry.doubleVal = tableData.getFloatField(8, float{}); + //entry.binaryVal = tableData.getvarbinaryField(9, varbinary{}); + entry.timeVal = tableData.getStringField(10, std::string{}.c_str()); + entry.charVal = tableData.getStringField(11, std::string{}.c_str()); + entry.name = tableData.getStringField(12, std::string{}.c_str()); + entry.nameLONG = tableData.getStringField(13, std::string{}.c_str()); + entry.nameShort = tableData.getStringField(14, std::string{}.c_str()); + this->m_entries.push_back(entry); + tableData.nextRow(); + } + + tableData.finalize(); +} + +CDtesttable2Table::~CDtesttable2Table() { +} + +std::string CDtesttable2Table::GetName(void) const { + return "testtable2"; +} + +std::vector CDtesttable2Table::Query(std::function predicate) { + std::vector data = cpplinq::from(this->m_entries) + >> cpplinq::where(predicate) + >> cpplinq::to_vector(); + + return data; +} + +std::vector CDtesttable2Table::GetEntries(void) const { + return this->m_entries; +} diff --git a/dDatabase/Tables/CDtesttable2Table.h b/dDatabase/Tables/CDtesttable2Table.h new file mode 100644 index 0000000..7ac60bd --- /dev/null +++ b/dDatabase/Tables/CDtesttable2Table.h @@ -0,0 +1,35 @@ +#pragma once +#include "CDTable.h" + +//Generated by xmlDb2dDatabaseGenerator on 2022-03-04 00:23:33.451621 +//DO NOT EDIT THIS FILE MANUALLY! + +struct CDtesttable2 { + int id; + float realVal; + std::string varCharVal; + int intVal; + uint64_t int64val; + bool bitVal; + int smallVal; + int tinyVal; + float doubleVal; + //varbinary binaryVal; + std::string timeVal; + std::string charVal; + std::string name; + std::string nameLONG; + std::string nameShort; +}; + +class CDtesttable2Table : public CDTable { +private: + std::vector m_entries; +public: + CDtesttable2Table(); + ~CDtesttable2Table(); + std::string GetName(void) const override; + +std::vector Query(std::function predicate); + std::vector GetEntries(void) const; +};