Faction.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * api/Faction.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 "Faction.h"
  12. #include "Registry.h"
  13. #include "../LuaStack.h"
  14. #include "../LuaCallWrapper.h"
  15. namespace scripting
  16. {
  17. namespace api
  18. {
  19. VCMI_REGISTER_CORE_SCRIPT_API(FactionProxy, "Faction");
  20. const std::vector<FactionProxy::RegType> FactionProxy::REGISTER = {};
  21. const std::vector<FactionProxy::CustomRegType> FactionProxy::REGISTER_CUSTOM =
  22. {
  23. {"getIconIndex", LuaMethodWrapper<Faction, int32_t(Entity:: *)()const, &Entity::getIconIndex>::invoke, false},
  24. {"getIndex", LuaMethodWrapper<Faction, int32_t(Entity:: *)()const, &Entity::getIndex>::invoke, false},
  25. {"getJsonKey", LuaMethodWrapper<Faction, const std::string &(Entity:: *)()const, &Entity::getJsonKey>::invoke, false},
  26. {"getName", LuaMethodWrapper<Faction, const std::string &(Entity:: *)()const, &Entity::getName>::invoke, false},
  27. {"hasTown", LuaMethodWrapper<Faction, bool(Faction:: *)()const, &Faction::hasTown>::invoke, false},
  28. };
  29. }
  30. }