1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-16 10:19:47 +02:00
vcmi/scripting/lua/api/events/BattleEvents.cpp

69 lines
1.4 KiB
C++
Raw Normal View History

/*
* BattleEvents.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "BattleEvents.h"
#include "../../LuaStack.h"
#include "../../LuaCallWrapper.h"
#include "../Registry.h"
#include "../../../../lib/battle/Unit.h"
#include "SubscriptionRegistryProxy.h"
namespace scripting
{
namespace api
{
namespace events
{
using ::events::ApplyDamage;
VCMI_REGISTER_SCRIPT_API(ApplyDamageProxy, "events.ApplyDamage");
2021-02-16 16:07:30 +02:00
const std::vector<ApplyDamageProxy::CustomRegType> ApplyDamageProxy::REGISTER_CUSTOM =
{
2021-02-16 16:07:30 +02:00
{
"subscribeBefore",
&SubscriptionRegistryProxy<ApplyDamageProxy>::subscribeBefore,
true
},
{
"subscribeAfter",
&SubscriptionRegistryProxy<ApplyDamageProxy>::subscribeAfter,
true
},
{
"getInitalDamage",
2021-02-16 16:07:30 +02:00
LuaMethodWrapper<ApplyDamage, decltype(&ApplyDamage::getInitalDamage), &ApplyDamage::getInitalDamage>::invoke,
false
},
{
"getDamage",
2021-02-16 16:07:30 +02:00
LuaMethodWrapper<ApplyDamage, decltype(&ApplyDamage::getDamage), &ApplyDamage::getDamage>::invoke,
false
},
{
"setDamage",
2021-02-16 16:07:30 +02:00
LuaMethodWrapper<ApplyDamage, decltype(&ApplyDamage::setDamage), &ApplyDamage::setDamage>::invoke,
false
},
{
"getTarget",
2021-02-16 16:07:30 +02:00
LuaMethodWrapper<ApplyDamage, decltype(&ApplyDamage::getTarget), &ApplyDamage::getTarget>::invoke,
false
},
2021-02-16 16:07:30 +02:00
};
}
}
}