mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 01:34:07 +00:00
Move CDClientManager to be a namespace (#1431)
Tested that worlds still load data as expected. Had no use being a singleton anyways.
This commit is contained in:
@@ -82,7 +82,7 @@ CDBehaviorParameterTable* Behavior::BehaviorParameterTable = nullptr;
|
||||
|
||||
Behavior* Behavior::GetBehavior(const uint32_t behaviorId) {
|
||||
if (BehaviorParameterTable == nullptr) {
|
||||
BehaviorParameterTable = CDClientManager::Instance().GetTable<CDBehaviorParameterTable>();
|
||||
BehaviorParameterTable = CDClientManager::GetTable<CDBehaviorParameterTable>();
|
||||
}
|
||||
|
||||
const auto pair = Cache.find(behaviorId);
|
||||
@@ -297,7 +297,7 @@ Behavior* Behavior::CreateBehavior(const uint32_t behaviorId) {
|
||||
}
|
||||
|
||||
BehaviorTemplates Behavior::GetBehaviorTemplate(const uint32_t behaviorId) {
|
||||
auto behaviorTemplateTable = CDClientManager::Instance().GetTable<CDBehaviorTemplateTable>();
|
||||
auto behaviorTemplateTable = CDClientManager::GetTable<CDBehaviorTemplateTable>();
|
||||
|
||||
BehaviorTemplates templateID = BehaviorTemplates::BEHAVIOR_EMPTY;
|
||||
// Find behavior template by its behavior id. Default to 0.
|
||||
@@ -405,7 +405,7 @@ void Behavior::PlayFx(std::u16string type, const LWOOBJID target, const LWOOBJID
|
||||
}
|
||||
|
||||
Behavior::Behavior(const uint32_t behaviorId) {
|
||||
auto behaviorTemplateTable = CDClientManager::Instance().GetTable<CDBehaviorTemplateTable>();
|
||||
auto behaviorTemplateTable = CDClientManager::GetTable<CDBehaviorTemplateTable>();
|
||||
|
||||
CDBehaviorTemplate templateInDatabase{};
|
||||
|
||||
@@ -448,7 +448,7 @@ Behavior::Behavior(const uint32_t behaviorId) {
|
||||
|
||||
float Behavior::GetFloat(const std::string& name, const float defaultValue) const {
|
||||
// Get the behavior parameter entry and return its value.
|
||||
if (!BehaviorParameterTable) BehaviorParameterTable = CDClientManager::Instance().GetTable<CDBehaviorParameterTable>();
|
||||
if (!BehaviorParameterTable) BehaviorParameterTable = CDClientManager::GetTable<CDBehaviorParameterTable>();
|
||||
return BehaviorParameterTable->GetValue(this->m_behaviorId, name, defaultValue);
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ Behavior* Behavior::GetAction(float value) const {
|
||||
std::map<std::string, float> Behavior::GetParameterNames() const {
|
||||
std::map<std::string, float> templatesInDatabase;
|
||||
// Find behavior template by its behavior id.
|
||||
if (!BehaviorParameterTable) BehaviorParameterTable = CDClientManager::Instance().GetTable<CDBehaviorParameterTable>();
|
||||
if (!BehaviorParameterTable) BehaviorParameterTable = CDClientManager::GetTable<CDBehaviorParameterTable>();
|
||||
if (BehaviorParameterTable) {
|
||||
templatesInDatabase = BehaviorParameterTable->GetParametersByBehaviorID(this->m_behaviorId);
|
||||
}
|
||||
|
@@ -41,7 +41,7 @@ void OverTimeBehavior::Load() {
|
||||
m_Action = GetInt("action");
|
||||
// Since m_Action is a skillID and not a behavior, get is correlated behaviorID.
|
||||
|
||||
CDSkillBehaviorTable* skillTable = CDClientManager::Instance().GetTable<CDSkillBehaviorTable>();
|
||||
CDSkillBehaviorTable* skillTable = CDClientManager::GetTable<CDSkillBehaviorTable>();
|
||||
m_ActionBehaviorId = skillTable->GetSkillByID(m_Action).behaviorID;
|
||||
|
||||
m_Delay = GetFloat("delay");
|
||||
|
Reference in New Issue
Block a user