Artifact.cpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * api/Artifact.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 "Artifact.h"
  12. #include "Registry.h"
  13. #include "../LuaStack.h"
  14. #include "../LuaCallWrapper.h"
  15. #include "../../../lib/HeroBonus.h"
  16. namespace scripting
  17. {
  18. namespace api
  19. {
  20. VCMI_REGISTER_CORE_SCRIPT_API(ArtifactProxy, "Artifact");
  21. const std::vector<ArtifactProxy::CustomRegType> ArtifactProxy::REGISTER_CUSTOM =
  22. {
  23. {"getIconIndex", LuaMethodWrapper<Artifact, decltype(&Entity::getIconIndex), &Entity::getIconIndex>::invoke, false},
  24. {"getIndex", LuaMethodWrapper<Artifact, decltype(&Entity::getIndex), &Entity::getIndex>::invoke, false},
  25. {"getJsonKey", LuaMethodWrapper<Artifact, decltype(&Entity::getJsonKey), &Entity::getJsonKey>::invoke, false},
  26. {"getName", LuaMethodWrapper<Artifact, decltype(&Entity::getName), &Entity::getName>::invoke, false},
  27. {"getId", LuaMethodWrapper<Artifact, decltype(&EntityT<ArtifactID>::getId), &EntityT<ArtifactID>::getId>::invoke, false},
  28. {"accessBonuses", LuaMethodWrapper<Artifact, decltype(&EntityWithBonuses<ArtifactID>::accessBonuses), &EntityWithBonuses<ArtifactID>::accessBonuses>::invoke, false},
  29. {"getDescription", LuaMethodWrapper<Artifact, decltype(&Artifact::getDescription), &Artifact::getDescription>::invoke, false},
  30. {"getEventText", LuaMethodWrapper<Artifact, decltype(&Artifact::getEventText), &Artifact::getEventText>::invoke, false},
  31. {"isBig", LuaMethodWrapper<Artifact, decltype(&Artifact::isBig), &Artifact::isBig>::invoke, false},
  32. {"isTradable", LuaMethodWrapper<Artifact, decltype(&Artifact::isTradable), &Artifact::isTradable>::invoke, false},
  33. {"getPrice", LuaMethodWrapper<Artifact, decltype(&Artifact::getPrice), &Artifact::getPrice>::invoke, false},
  34. };
  35. }
  36. }