GameCb.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * GameCb.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 "GameCb.h"
  12. #include <vcmi/Player.h>
  13. #include "../LuaCallWrapper.h"
  14. #include "../../../lib/mapObjects/CGHeroInstance.h"
  15. VCMI_LIB_NAMESPACE_BEGIN
  16. namespace scripting
  17. {
  18. namespace api
  19. {
  20. VCMI_REGISTER_CORE_SCRIPT_API(GameCbProxy, "Game");
  21. const std::vector<GameCbProxy::CustomRegType> GameCbProxy::REGISTER_CUSTOM =
  22. {
  23. {"getDate", LuaMethodWrapper<GameCb, decltype(&GameCb::getDate), &GameCb::getDate>::invoke, false},
  24. {"getPlayer", LuaMethodWrapper<GameCb, decltype(&GameCb::getPlayer), &GameCb::getPlayer>::invoke, false},
  25. {"getHero", LuaMethodWrapper<GameCb, decltype(&GameCb::getHero), &GameCb::getHero>::invoke, false},
  26. {"getHeroWithSubid", LuaMethodWrapper<GameCb, decltype(&GameCb::getHeroWithSubid), &GameCb::getHeroWithSubid>::invoke, false},
  27. {"getObj", LuaMethodWrapper<GameCb, decltype(&GameCb::getObj), &GameCb::getObj>::invoke, false},
  28. };
  29. }
  30. }
  31. VCMI_LIB_NAMESPACE_END