CDClient cleanup and optimization (#1023)

* CDClient cleanup and optimization

- Use static function to get table name
- Remove unused GetName function
- Replace above function with a static GetTableName function
- Remove verbose comments
- Remove verbose initializers
- Remove need to specify table name when getting a table by name
- Remove unused typedef for mac and linux

* Re-add unused table

Convert tables to singletons

- Convert all CDClient tables to singletons
- Move Singleton.h to dCommon
- Reduce header clutter in CDClientManager
This commit is contained in:
David Markowitz
2023-03-17 07:36:21 -07:00
committed by GitHub
parent bd79e9433c
commit 7671cc6865
121 changed files with 399 additions and 1584 deletions

View File

@@ -1,46 +1,80 @@
#include "CDClientManager.h"
#include "CDActivityRewardsTable.h"
#include "CDAnimationsTable.h"
#include "CDBehaviorParameterTable.h"
#include "CDBehaviorTemplateTable.h"
#include "CDComponentsRegistryTable.h"
#include "CDCurrencyTableTable.h"
#include "CDDestructibleComponentTable.h"
#include "CDEmoteTable.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 "CDMissionTasksTable.h"
#include "CDMissionsTable.h"
#include "CDObjectSkillsTable.h"
#include "CDObjectsTable.h"
#include "CDPhysicsComponentTable.h"
#include "CDRebuildComponentTable.h"
#include "CDScriptComponentTable.h"
#include "CDSkillBehaviorTable.h"
#include "CDZoneTableTable.h"
#include "CDVendorComponentTable.h"
#include "CDActivitiesTable.h"
#include "CDPackageComponentTable.h"
#include "CDProximityMonitorComponentTable.h"
#include "CDMovementAIComponentTable.h"
#include "CDBrickIDTableTable.h"
#include "CDRarityTableTable.h"
#include "CDMissionEmailTable.h"
#include "CDRewardsTable.h"
#include "CDPropertyEntranceComponentTable.h"
#include "CDPropertyTemplateTable.h"
#include "CDFeatureGatingTable.h"
#include "CDRailActivatorComponent.h"
// Static Variables
CDClientManager* CDClientManager::m_Address = nullptr;
//! Initializes the manager
void CDClientManager::Initialize(void) {
tables.insert(std::make_pair("ActivityRewards", new CDActivityRewardsTable()));
UNUSED(tables.insert(std::make_pair("Animations", new CDAnimationsTable())));
tables.insert(std::make_pair("BehaviorParameter", new CDBehaviorParameterTable()));
tables.insert(std::make_pair("BehaviorTemplate", new CDBehaviorTemplateTable()));
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("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("LootMatrix", new CDLootMatrixTable()));
tables.insert(std::make_pair("LootTable", new CDLootTableTable()));
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()));
tables.insert(std::make_pair("Objects", new CDObjectsTable()));
tables.insert(std::make_pair("PhysicsComponent", new CDPhysicsComponentTable()));
tables.insert(std::make_pair("RebuildComponent", new CDRebuildComponentTable()));
tables.insert(std::make_pair("ScriptComponent", new CDScriptComponentTable()));
tables.insert(std::make_pair("SkillBehavior", new CDSkillBehaviorTable()));
tables.insert(std::make_pair("ZoneTable", new CDZoneTableTable()));
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("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("PropertyTemplate", new CDPropertyTemplateTable()));
tables.insert(std::make_pair("FeatureGating", new CDFeatureGatingTable()));
tables.insert(std::make_pair("RailActivatorComponent", new CDRailActivatorComponentTable()));
CDClientManager::CDClientManager() {
CDActivityRewardsTable::Instance();
UNUSED(CDAnimationsTable::Instance());
CDBehaviorParameterTable::Instance();
CDBehaviorTemplateTable::Instance();
CDComponentsRegistryTable::Instance();
CDCurrencyTableTable::Instance();
CDDestructibleComponentTable::Instance();
CDEmoteTableTable::Instance();
CDInventoryComponentTable::Instance();
CDItemComponentTable::Instance();
CDItemSetsTable::Instance();
CDItemSetSkillsTable::Instance();
CDLevelProgressionLookupTable::Instance();
CDLootMatrixTable::Instance();
CDLootTableTable::Instance();
CDMissionNPCComponentTable::Instance();
CDMissionTasksTable::Instance();
CDMissionsTable::Instance();
CDObjectSkillsTable::Instance();
CDObjectsTable::Instance();
CDPhysicsComponentTable::Instance();
CDRebuildComponentTable::Instance();
CDScriptComponentTable::Instance();
CDSkillBehaviorTable::Instance();
CDZoneTableTable::Instance();
CDVendorComponentTable::Instance();
CDActivitiesTable::Instance();
CDPackageComponentTable::Instance();
CDProximityMonitorComponentTable::Instance();
CDMovementAIComponentTable::Instance();
CDBrickIDTableTable::Instance();
CDRarityTableTable::Instance();
CDMissionEmailTable::Instance();
CDRewardsTable::Instance();
CDPropertyEntranceComponentTable::Instance();
CDPropertyTemplateTable::Instance();
CDFeatureGatingTable::Instance();
CDRailActivatorComponentTable::Instance();
}