Eluna add event group type name to the error messages

This commit is contained in:
Rochet2
2014-06-17 21:47:39 +03:00
committed by Foereaper
parent 79fd1d5bab
commit 0fd1615887
3 changed files with 44 additions and 33 deletions

View File

@@ -686,25 +686,36 @@ template<> Corpse* Eluna::CHECKOBJ<Corpse>(lua_State* L, int narg, bool error);
// #define ELUNA_GUARD() ACE_Guard< ACE_Recursive_Thread_Mutex > ELUNA_GUARD_OBJECT(sEluna->lock);
template<typename T>
struct EventBind
struct ElunaBind
{
typedef std::vector<int> ElunaBindingMap;
typedef std::map<int, ElunaBindingMap> ElunaEntryMap;
Eluna& E;
const char* groupName;
EventBind(Eluna& _E): E(_E)
ElunaBind(const char* bindGroupName, Eluna& _E): E(_E), groupName(bindGroupName)
{
}
~EventBind()
~ElunaBind()
{
Clear();
}
// unregisters all registered functions and clears all registered events from the bindings
virtual void Clear() {};
};
template<typename T>
struct EventBind : ElunaBind
{
typedef std::vector<int> ElunaBindingMap;
typedef std::map<int, ElunaBindingMap> ElunaEntryMap;
EventBind(const char* bindGroupName, Eluna& _E): ElunaBind(bindGroupName, _E)
{
}
// unregisters all registered functions and clears all registered events from the bind std::maps (reset)
void Clear()
void Clear() override
{
for (ElunaEntryMap::iterator itr = Bindings.begin(); itr != Bindings.end(); ++itr)
{
@@ -746,23 +757,17 @@ struct EventBind
};
template<typename T>
struct EntryBind
struct EntryBind : ElunaBind
{
typedef std::map<int, int> ElunaBindingMap;
typedef UNORDERED_MAP<uint32, ElunaBindingMap> ElunaEntryMap;
Eluna& E;
EntryBind(Eluna& _E): E(_E)
EntryBind(const char* bindGroupName, Eluna& _E): ElunaBind(bindGroupName, _E)
{
}
~EntryBind()
{
Clear();
}
void Clear() // unregisters all registered functions and clears all registered events from the bind std::maps (reset)
// unregisters all registered functions and clears all registered events from the bindmap
void Clear() override
{
for (ElunaEntryMap::iterator itr = Bindings.begin(); itr != Bindings.end(); ++itr)
{