2
0

UnitProxy.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * UnitProxy.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "UnitProxy.h"
  12. #include "../../LuaStack.h"
  13. #include "../../LuaCallWrapper.h"
  14. #include "../Registry.h"
  15. namespace scripting
  16. {
  17. namespace api
  18. {
  19. namespace battle
  20. {
  21. VCMI_REGISTER_SCRIPT_API(UnitProxy, "battle.Unit")
  22. const std::vector<UnitProxy::CustomRegType> UnitProxy::REGISTER_CUSTOM =
  23. {
  24. {"getMinDamage", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getMinDamage), &IBonusBearer::getMinDamage>::invoke, false},
  25. {"getMaxDamage", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getMaxDamage), &IBonusBearer::getMaxDamage>::invoke, false},
  26. {"getAttack", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getAttack), &IBonusBearer::getAttack>::invoke, false},
  27. {"getDefense", LuaMethodWrapper<Unit, decltype(&IBonusBearer::getDefense), &IBonusBearer::getDefense>::invoke, false},
  28. {"isAlive", LuaMethodWrapper<Unit, decltype(&Unit::alive), &Unit::alive>::invoke, false},
  29. {"unitId", LuaMethodWrapper<Unit, decltype(&IUnitInfo::unitId), &IUnitInfo::unitId>::invoke, false},
  30. };
  31. }
  32. }
  33. }