Skip to content

Commit b1766e9

Browse files
committed
Rename helper functions from Register Event to Register Binding
1 parent 5a91619 commit b1766e9

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

LuaEngine.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ static void createCancelCallback(Eluna* e, uint64 bindingID, BindingMap<K>* bind
666666
}
667667

668668
template<typename K>
669-
int RegisterBasicEvent(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32 event_id, int functionRef, uint32 shots)
669+
int RegisterBasicBinding(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32 event_id, int functionRef, uint32 shots)
670670
{
671671
typedef EventKey<K> Key;
672672
auto binding = e->GetBinding<Key>(regtype);
@@ -677,7 +677,7 @@ int RegisterBasicEvent(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> re
677677
}
678678

679679
template<typename K>
680-
int RegisterEntryEvent(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32 entry, uint32 event_id, int functionRef, uint32 shots)
680+
int RegisterEntryBinding(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32 entry, uint32 event_id, int functionRef, uint32 shots)
681681
{
682682
typedef EntryKey<K> Key;
683683
auto binding = e->GetBinding<Key>(regtype);
@@ -688,7 +688,7 @@ int RegisterEntryEvent(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> re
688688
}
689689

690690
template<typename K>
691-
int RegisterUniqueEvent(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, ObjectGuid guid, uint32 instanceId, uint32 event_id, int functionRef, uint32 shots)
691+
int RegisterUniqueBinding(Eluna* e, std::underlying_type_t<Hooks::RegisterTypes> regtype, ObjectGuid guid, uint32 instanceId, uint32 event_id, int functionRef, uint32 shots)
692692
{
693693
typedef UniqueObjectKey<K> Key;
694694
auto binding = e->GetBinding<Key>(regtype);
@@ -705,32 +705,32 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
705705
{
706706
case Hooks::REGTYPE_SERVER:
707707
if (event_id < Hooks::SERVER_EVENT_COUNT)
708-
return RegisterBasicEvent<Hooks::ServerEvents>(this, regtype, event_id, functionRef, shots);
708+
return RegisterBasicBinding<Hooks::ServerEvents>(this, regtype, event_id, functionRef, shots);
709709
break;
710710

711711
case Hooks::REGTYPE_PLAYER:
712712
if (event_id < Hooks::PLAYER_EVENT_COUNT)
713-
return RegisterBasicEvent<Hooks::PlayerEvents>(this, regtype, event_id, functionRef, shots);
713+
return RegisterBasicBinding<Hooks::PlayerEvents>(this, regtype, event_id, functionRef, shots);
714714
break;
715715

716716
case Hooks::REGTYPE_GUILD:
717717
if (event_id < Hooks::GUILD_EVENT_COUNT)
718-
return RegisterBasicEvent<Hooks::GuildEvents>(this, regtype, event_id, functionRef, shots);
718+
return RegisterBasicBinding<Hooks::GuildEvents>(this, regtype, event_id, functionRef, shots);
719719
break;
720720

721721
case Hooks::REGTYPE_GROUP:
722722
if (event_id < Hooks::GROUP_EVENT_COUNT)
723-
return RegisterBasicEvent<Hooks::GroupEvents>(this, regtype, event_id, functionRef, shots);
723+
return RegisterBasicBinding<Hooks::GroupEvents>(this, regtype, event_id, functionRef, shots);
724724
break;
725725

726726
case Hooks::REGTYPE_VEHICLE:
727727
if (event_id < Hooks::VEHICLE_EVENT_COUNT)
728-
return RegisterBasicEvent<Hooks::VehicleEvents>(this, regtype, event_id, functionRef, shots);
728+
return RegisterBasicBinding<Hooks::VehicleEvents>(this, regtype, event_id, functionRef, shots);
729729
break;
730730

731731
case Hooks::REGTYPE_BG:
732732
if (event_id < Hooks::BG_EVENT_COUNT)
733-
return RegisterBasicEvent<Hooks::BGEvents>(this, regtype, event_id, functionRef, shots);
733+
return RegisterBasicBinding<Hooks::BGEvents>(this, regtype, event_id, functionRef, shots);
734734
break;
735735

736736
case Hooks::REGTYPE_PACKET:
@@ -742,7 +742,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
742742
luaL_error(L, "Couldn't find a creature with (ID: %d)!", entry);
743743
return 0; // Stack: (empty)
744744
}
745-
return RegisterEntryEvent<Hooks::PacketEvents>(this, regtype, entry, event_id, functionRef, shots);
745+
return RegisterEntryBinding<Hooks::PacketEvents>(this, regtype, entry, event_id, functionRef, shots);
746746
}
747747
break;
748748

@@ -755,7 +755,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
755755
luaL_error(L, "Couldn't find a creature with (ID: %d)!", entry);
756756
return 0; // Stack: (empty)
757757
}
758-
return RegisterEntryEvent<Hooks::CreatureEvents>(this, regtype, entry, event_id, functionRef, shots);
758+
return RegisterEntryBinding<Hooks::CreatureEvents>(this, regtype, entry, event_id, functionRef, shots);
759759
}
760760
break;
761761

@@ -768,7 +768,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
768768
luaL_error(L, "guid was 0!");
769769
return 0; // Stack: (empty)
770770
}
771-
return RegisterUniqueEvent<Hooks::CreatureEvents>(this, regtype, guid, instanceId, event_id, functionRef, shots);
771+
return RegisterUniqueBinding<Hooks::CreatureEvents>(this, regtype, guid, instanceId, event_id, functionRef, shots);
772772
}
773773
break;
774774

@@ -781,7 +781,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
781781
luaL_error(L, "Couldn't find a creature with (ID: %d)!", entry);
782782
return 0; // Stack: (empty)
783783
}
784-
return RegisterEntryEvent<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
784+
return RegisterEntryBinding<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
785785
}
786786
break;
787787

@@ -794,7 +794,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
794794
luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", entry);
795795
return 0; // Stack: (empty)
796796
}
797-
return RegisterEntryEvent<Hooks::GameObjectEvents>(this, regtype, entry, event_id, functionRef, shots);
797+
return RegisterEntryBinding<Hooks::GameObjectEvents>(this, regtype, entry, event_id, functionRef, shots);
798798
}
799799
break;
800800

@@ -807,13 +807,13 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
807807
luaL_error(L, "Couldn't find a gameobject with (ID: %d)!", entry);
808808
return 0; // Stack: (empty)
809809
}
810-
return RegisterEntryEvent<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
810+
return RegisterEntryBinding<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
811811
}
812812
break;
813813

814814
case Hooks::REGTYPE_SPELL:
815815
if (event_id < Hooks::SPELL_EVENT_COUNT)
816-
return RegisterEntryEvent<Hooks::SpellEvents>(this, regtype, entry, event_id, functionRef, shots);
816+
return RegisterEntryBinding<Hooks::SpellEvents>(this, regtype, entry, event_id, functionRef, shots);
817817
break;
818818

819819
case Hooks::REGTYPE_ITEM:
@@ -826,7 +826,7 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
826826
return 0; // Stack: (empty)
827827
}
828828

829-
return RegisterEntryEvent<Hooks::ItemEvents>(this, regtype, entry, event_id, functionRef, shots);
829+
return RegisterEntryBinding<Hooks::ItemEvents>(this, regtype, entry, event_id, functionRef, shots);
830830
}
831831
break;
832832

@@ -840,19 +840,19 @@ int Eluna::Register(std::underlying_type_t<Hooks::RegisterTypes> regtype, uint32
840840
return 0; // Stack: (empty)
841841
}
842842

843-
return RegisterEntryEvent<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
843+
return RegisterEntryBinding<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
844844
}
845845
break;
846846

847847
case Hooks::REGTYPE_PLAYER_GOSSIP:
848848
if (event_id < Hooks::GOSSIP_EVENT_COUNT)
849-
return RegisterEntryEvent<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
849+
return RegisterEntryBinding<Hooks::GossipEvents>(this, regtype, entry, event_id, functionRef, shots);
850850
break;
851851

852852
case Hooks::REGTYPE_MAP:
853853
case Hooks::REGTYPE_INSTANCE:
854854
if (event_id < Hooks::INSTANCE_EVENT_COUNT)
855-
return RegisterEntryEvent<Hooks::InstanceEvents>(this, regtype, entry, event_id, functionRef, shots);
855+
return RegisterEntryBinding<Hooks::InstanceEvents>(this, regtype, entry, event_id, functionRef, shots);
856856
break;
857857
}
858858
luaL_unref(L, LUA_REGISTRYINDEX, functionRef);

0 commit comments

Comments
 (0)