1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Less ugly API declarations

This commit is contained in:
AlexVinS
2021-02-16 17:07:30 +03:00
parent ec6f7b88fe
commit 6d245a7821
59 changed files with 693 additions and 827 deletions

View File

@@ -26,21 +26,20 @@ class BonusProxy : public SharedWrapper<const Bonus, BonusProxy>
public:
using Wrapper = SharedWrapper<const Bonus, BonusProxy>;
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
static int getType(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSubtype(lua_State * L, std::shared_ptr<const Bonus> object);
static int getDuration(lua_State * L, std::shared_ptr<const Bonus> object);
static int getTurns(lua_State * L, std::shared_ptr<const Bonus> object);
static int getValueType(lua_State * L, std::shared_ptr<const Bonus> object);
static int getVal(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSource(lua_State * L, std::shared_ptr<const Bonus> object);
static int getSourceID(lua_State * L, std::shared_ptr<const Bonus> object);
static int getDescription(lua_State * L, std::shared_ptr<const Bonus> object);
static int getEffectRange(lua_State * L, std::shared_ptr<const Bonus> object);
static int getStacking(lua_State * L, std::shared_ptr<const Bonus> object);
static int toJsonNode(lua_State * L, std::shared_ptr<const Bonus> object);
static int getType(lua_State * L);
static int getSubtype(lua_State * L);
static int getDuration(lua_State * L);
static int getTurns(lua_State * L);
static int getValueType(lua_State * L);
static int getVal(lua_State * L);
static int getSource(lua_State * L);
static int getSourceID(lua_State * L);
static int getDescription(lua_State * L);
static int getEffectRange(lua_State * L);
static int getStacking(lua_State * L);
static int toJsonNode(lua_State * L);
protected:
virtual void adjustStaticTable(lua_State * L) const override;
@@ -51,10 +50,9 @@ class BonusListProxy : public SharedWrapper<const BonusList, BonusListProxy>
public:
using Wrapper = SharedWrapper<const BonusList, BonusListProxy>;
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
static int index(lua_State * L);
static std::shared_ptr<const Bonus> index(std::shared_ptr<const BonusList> self, int key);
protected:
virtual void adjustMetatable(lua_State * L) const override;
};
@@ -64,10 +62,9 @@ class BonusBearerProxy : public OpaqueWrapper<const IBonusBearer, BonusBearerPro
public:
using Wrapper = OpaqueWrapper<const IBonusBearer, BonusBearerProxy>;
static int getBonuses(lua_State * L, const IBonusBearer * object);
static const std::vector<typename Wrapper::RegType> REGISTER;
static const std::vector<typename Wrapper::CustomRegType> REGISTER_CUSTOM;
static int getBonuses(lua_State * L);
};