2021-12-05 17:54:36 +00:00
|
|
|
#include "CDBehaviorTemplateTable.h"
|
|
|
|
|
2022-08-11 14:36:03 +00:00
|
|
|
#include "CDProvider.h"
|
|
|
|
|
|
|
|
CDBehaviorTemplate EmptyBehaviorTemplate {0, 0, 0, 0};
|
|
|
|
|
|
|
|
CD_PROVIDER(BehaviorTemplateProvider, uint32_t, CDBehaviorTemplate);
|
|
|
|
|
2021-12-05 17:54:36 +00:00
|
|
|
//! Constructor
|
|
|
|
CDBehaviorTemplateTable::CDBehaviorTemplateTable(void) {
|
2022-08-11 14:36:03 +00:00
|
|
|
NEW_CD_PROVIDER(BehaviorTemplateProvider, "BehaviorTemplate", [](CppSQLite3Query& query) {
|
2021-12-05 17:54:36 +00:00
|
|
|
CDBehaviorTemplate entry;
|
|
|
|
|
2022-08-11 14:36:03 +00:00
|
|
|
entry.behaviorID = query.getIntField(0, -1);
|
|
|
|
entry.templateID = query.getIntField(1, -1);
|
|
|
|
entry.effectID = query.getIntField(2, -1);
|
|
|
|
entry.effectHandle = CDTable::SetString(query.getStringField(3, ""));
|
|
|
|
|
|
|
|
return std::make_pair(entry.behaviorID, entry);
|
|
|
|
}, [](int32_t size) {
|
|
|
|
return 40 * 1000 * 1000;
|
|
|
|
}, false);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//! Destructor
|
|
|
|
CDBehaviorTemplateTable::~CDBehaviorTemplateTable(void) { }
|
|
|
|
|
|
|
|
//! Returns the table's name
|
|
|
|
std::string CDBehaviorTemplateTable::GetName(void) const {
|
|
|
|
return "BehaviorTemplate";
|
|
|
|
}
|
|
|
|
|
2022-08-11 14:36:03 +00:00
|
|
|
const CDBehaviorTemplate& CDBehaviorTemplateTable::GetByBehaviorID(uint32_t behaviorID) const {
|
|
|
|
return BehaviorTemplateProvider->GetEntry(behaviorID, EmptyBehaviorTemplate);
|
2021-12-05 17:54:36 +00:00
|
|
|
}
|
2022-07-09 06:07:52 +00:00
|
|
|
|
2022-08-11 14:36:03 +00:00
|
|
|
void CDBehaviorTemplateTable::LoadHost() {
|
|
|
|
BehaviorTemplateProvider->LoadHost();
|
2022-07-09 06:07:52 +00:00
|
|
|
}
|