mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Less ugly API declarations
This commit is contained in:
@ -25,37 +25,14 @@ namespace battle
|
||||
|
||||
VCMI_REGISTER_SCRIPT_API(UnitProxy, "battle.Unit")
|
||||
|
||||
const std::vector<UnitProxy::RegType> UnitProxy::REGISTER =
|
||||
{
|
||||
{
|
||||
"getMinDamage",
|
||||
LuaCallWrapper<const IBonusBearer>::createFunctor(&IBonusBearer::getMinDamage)
|
||||
},
|
||||
{
|
||||
"getMaxDamage",
|
||||
LuaCallWrapper<const IBonusBearer>::createFunctor(&IBonusBearer::getMaxDamage)
|
||||
},
|
||||
{
|
||||
"getAttack",
|
||||
LuaCallWrapper<const IBonusBearer>::createFunctor(&IBonusBearer::getAttack)
|
||||
},
|
||||
{
|
||||
"getDefense",
|
||||
LuaCallWrapper<const IBonusBearer>::createFunctor(&IBonusBearer::getDefense)
|
||||
},
|
||||
{
|
||||
"isAlive",
|
||||
LuaCallWrapper<const Unit>::createFunctor(&Unit::alive)
|
||||
},
|
||||
{
|
||||
"unitId",
|
||||
LuaCallWrapper<const IUnitInfo>::createFunctor(&IUnitInfo::unitId)
|
||||
}
|
||||
};
|
||||
|
||||
const std::vector<UnitProxy::CustomRegType> UnitProxy::REGISTER_CUSTOM =
|
||||
{
|
||||
|
||||
{"getMinDamage", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getMinDamage), &IBonusBearer::getMinDamage>::invoke, false},
|
||||
{"getMaxDamage", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getMaxDamage), &IBonusBearer::getMaxDamage>::invoke, false},
|
||||
{"getAttack", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getAttack), &IBonusBearer::getAttack>::invoke, false},
|
||||
{"getDefense", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getDefense), &IBonusBearer::getDefense>::invoke, false},
|
||||
{"isAlive", LuaMethodWrapper<Unit, decltype(&Unit::alive), &Unit::alive>::invoke, false},
|
||||
{"unitId", LuaMethodWrapper<Unit, decltype(&IUnitInfo::unitId), &IUnitInfo::unitId>::invoke, false},
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user