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
|
|
|
|
|
|
|
/*!
|
|
|
|
\file CDBehaviorTemplateTable.hpp
|
|
|
|
\brief Contains data for the BehaviorTemplate table
|
|
|
|
*/
|
|
|
|
|
2022-07-28 13:39:57 +00:00
|
|
|
//! BehaviorTemplate Entry Struct
|
2021-12-05 17:54:36 +00:00
|
|
|
struct CDBehaviorTemplate {
|
2022-07-28 13:39:57 +00:00
|
|
|
unsigned int behaviorID; //!< The Behavior ID
|
|
|
|
unsigned int templateID; //!< The Template ID (LOT)
|
|
|
|
unsigned int effectID; //!< The Effect ID attached
|
|
|
|
std::unordered_set<std::string>::iterator effectHandle; //!< The effect handle
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//! BehaviorTemplate table
|
|
|
|
class CDBehaviorTemplateTable : public CDTable {
|
|
|
|
private:
|
2022-07-28 13:39:57 +00:00
|
|
|
std::vector<CDBehaviorTemplate> entries;
|
|
|
|
std::unordered_map<uint32_t, CDBehaviorTemplate> entriesMappedByBehaviorID;
|
|
|
|
std::unordered_set<std::string> m_EffectHandles;
|
2021-12-05 17:54:36 +00:00
|
|
|
public:
|
2022-07-28 13:39:57 +00:00
|
|
|
|
|
|
|
//! 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<CDBehaviorTemplate> Query(std::function<bool(CDBehaviorTemplate)> predicate);
|
|
|
|
|
|
|
|
//! Gets all the entries in the table
|
|
|
|
/*!
|
|
|
|
\return The entries
|
|
|
|
*/
|
|
|
|
std::vector<CDBehaviorTemplate> GetEntries(void) const;
|
|
|
|
|
|
|
|
const CDBehaviorTemplate GetByBehaviorID(uint32_t behaviorID);
|
2021-12-05 17:54:36 +00:00
|
|
|
};
|