Files
PkmnLib/src/Battling/PkmnScriptHook.hpp
Deukhoofd c4b866cb38
All checks were successful
continuous-integration/drone/push Build is passing
File formatting.
2020-04-28 14:48:56 +02:00

14 lines
1.2 KiB
C++

#include "PkmnScript.hpp"
#define PKMN_HOOK(hookName, source, ...) \
{ \
auto aggregator = source->GetScriptIterator(); \
while (aggregator.HasNext()) { \
auto next = aggregator.GetNext(); \
if (next == nullptr) \
continue; \
auto castNext = dynamic_cast<PkmnLib::Battling::PkmnScript*>(next); \
castNext->hookName(__VA_ARGS__); \
} \
}