AdventureEvents.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * AdventureEvents.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 "AdventureEvents.h"
  12. #include "../../LuaStack.h"
  13. #include "../../LuaCallWrapper.h"
  14. #include "../Registry.h"
  15. #include "SubscriptionRegistryProxy.h"
  16. namespace scripting
  17. {
  18. namespace api
  19. {
  20. namespace events
  21. {
  22. VCMI_REGISTER_SCRIPT_API(ObjectVisitStartedProxy, "events.ObjectVisitStarted");
  23. const std::vector<ObjectVisitStartedProxy::RegType> ObjectVisitStartedProxy::REGISTER = {};
  24. const std::vector<ObjectVisitStartedProxy::CustomRegType> ObjectVisitStartedProxy::REGISTER_CUSTOM =
  25. {
  26. {
  27. "subscribeBefore",
  28. &SubscriptionRegistryProxy<ObjectVisitStartedProxy>::subscribeBefore,
  29. true
  30. },
  31. {
  32. "subscribeAfter",
  33. &SubscriptionRegistryProxy<ObjectVisitStartedProxy>::subscribeAfter,
  34. true
  35. },
  36. {
  37. "getPlayer",
  38. LuaMethodWrapper<ObjectVisitStarted, PlayerColor(ObjectVisitStarted:: *)()const, &ObjectVisitStarted::getPlayer>::invoke,
  39. false
  40. },
  41. {
  42. "getHero",
  43. LuaMethodWrapper<ObjectVisitStarted, ObjectInstanceID(ObjectVisitStarted:: *)()const, &ObjectVisitStarted::getHero>::invoke,
  44. false
  45. },
  46. {
  47. "getObject",
  48. LuaMethodWrapper<ObjectVisitStarted, ObjectInstanceID(ObjectVisitStarted:: *)()const, &ObjectVisitStarted::getObject>::invoke,
  49. false
  50. },
  51. };
  52. }
  53. }
  54. }