2
0

BonusSystem.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * BonusSystem.h, 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. #pragma once
  11. #include "../LuaWrapper.h"
  12. class Bonus;
  13. class BonusList;
  14. class IBonusBearer;
  15. namespace scripting
  16. {
  17. namespace api
  18. {
  19. class BonusProxy : public SharedWrapper<const Bonus, BonusProxy>
  20. {
  21. public:
  22. using Wrapper = SharedWrapper<const Bonus, BonusProxy>;
  23. static const std::vector<typename Wrapper::RegType> REGISTER;
  24. static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
  25. static int getType(lua_State * L, std::shared_ptr<const Bonus> object);
  26. static int getSubtype(lua_State * L, std::shared_ptr<const Bonus> object);
  27. static int getDuration(lua_State * L, std::shared_ptr<const Bonus> object);
  28. static int getTurns(lua_State * L, std::shared_ptr<const Bonus> object);
  29. static int getValueType(lua_State * L, std::shared_ptr<const Bonus> object);
  30. static int getVal(lua_State * L, std::shared_ptr<const Bonus> object);
  31. static int getSource(lua_State * L, std::shared_ptr<const Bonus> object);
  32. static int getSourceID(lua_State * L, std::shared_ptr<const Bonus> object);
  33. static int getDescription(lua_State * L, std::shared_ptr<const Bonus> object);
  34. static int getEffectRange(lua_State * L, std::shared_ptr<const Bonus> object);
  35. static int getStacking(lua_State * L, std::shared_ptr<const Bonus> object);
  36. static int toJsonNode(lua_State * L, std::shared_ptr<const Bonus> object);
  37. protected:
  38. virtual void adjustStaticTable(lua_State * L) const override;
  39. };
  40. class BonusListProxy : public SharedWrapper<const BonusList, BonusListProxy>
  41. {
  42. public:
  43. using Wrapper = SharedWrapper<const BonusList, BonusListProxy>;
  44. static const std::vector<typename Wrapper::RegType> REGISTER;
  45. static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
  46. static int index(lua_State * L);
  47. protected:
  48. virtual void adjustMetatable(lua_State * L) const override;
  49. };
  50. class BonusBearerProxy : public OpaqueWrapper<const IBonusBearer, BonusBearerProxy>
  51. {
  52. public:
  53. using Wrapper = OpaqueWrapper<const IBonusBearer, BonusBearerProxy>;
  54. static int getBonuses(lua_State * L, const IBonusBearer * object);
  55. static const std::vector<typename Wrapper::RegType> REGISTER;
  56. static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
  57. };
  58. }
  59. }