2021-12-05 17:54:36 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Custom Classes
|
|
|
|
#include "CDTable.h"
|
2022-07-09 06:07:52 +00:00
|
|
|
#include <unordered_map>
|
2022-07-12 03:43:09 +00:00
|
|
|
#include <unordered_set>
|
2021-12-05 17:54:36 +00:00
|
|
|
|
|
|
|
struct CDBehaviorTemplate {
|
2024-01-09 07:54:14 +00:00
|
|
|
uint32_t behaviorID; //!< The Behavior ID
|
|
|
|
uint32_t templateID; //!< The Template ID (LOT)
|
|
|
|
uint32_t effectID; //!< The Effect ID attached
|
2022-07-12 03:43:09 +00:00
|
|
|
std::unordered_set<std::string>::iterator effectHandle; //!< The effect handle
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2023-03-17 14:36:21 +00:00
|
|
|
class CDBehaviorTemplateTable : public CDTable<CDBehaviorTemplateTable> {
|
2021-12-05 17:54:36 +00:00
|
|
|
private:
|
|
|
|
std::vector<CDBehaviorTemplate> entries;
|
2022-07-09 06:07:52 +00:00
|
|
|
std::unordered_map<uint32_t, CDBehaviorTemplate> entriesMappedByBehaviorID;
|
2022-07-12 03:43:09 +00:00
|
|
|
std::unordered_set<std::string> m_EffectHandles;
|
2021-12-05 17:54:36 +00:00
|
|
|
public:
|
2023-08-11 04:27:40 +00:00
|
|
|
void LoadValuesFromDatabase();
|
|
|
|
|
2023-03-17 14:36:21 +00:00
|
|
|
// Queries the table with a custom "where" clause
|
2021-12-05 17:54:36 +00:00
|
|
|
std::vector<CDBehaviorTemplate> Query(std::function<bool(CDBehaviorTemplate)> predicate);
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2023-08-11 04:27:40 +00:00
|
|
|
const std::vector<CDBehaviorTemplate>& GetEntries(void) const;
|
2022-07-28 13:39:57 +00:00
|
|
|
|
2022-07-09 06:07:52 +00:00
|
|
|
const CDBehaviorTemplate GetByBehaviorID(uint32_t behaviorID);
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|