Make most of the battle library use unique_ptr.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-26 15:11:04 +02:00
parent e46117ea06
commit 16b67b0d54
6 changed files with 27 additions and 25 deletions

View File

@@ -15,11 +15,14 @@ export void CreatureLib_BattleLibrary_Destruct(const BattleLibrary* p) { delete
#define SIMPLE_GET_FUNC(type, name, returnType) \
export returnType CreatureLib_##type##_##name(const type* p) { return p->name(); }
#define SIMPLE_GET_FUNC_SMART_PTR(type, name, returnType) \
export returnType CreatureLib_##type##_##name(const type* p) { return p->name().operator->(); }
SIMPLE_GET_FUNC(BattleLibrary, GetStaticLib, const CreatureLib::Library::DataLibrary*);
SIMPLE_GET_FUNC(BattleLibrary, GetStatCalculator, const BattleStatCalculator*);
SIMPLE_GET_FUNC(BattleLibrary, GetDamageLibrary, const DamageLibrary*);
SIMPLE_GET_FUNC(BattleLibrary, GetMiscLibrary, const MiscLibrary*);
SIMPLE_GET_FUNC(BattleLibrary, GetExperienceLibrary, const ExperienceLibrary*);
SIMPLE_GET_FUNC_SMART_PTR(BattleLibrary, GetStatCalculator, const BattleStatCalculator*);
SIMPLE_GET_FUNC_SMART_PTR(BattleLibrary, GetDamageLibrary, const DamageLibrary*);
SIMPLE_GET_FUNC_SMART_PTR(BattleLibrary, GetMiscLibrary, const MiscLibrary*);
SIMPLE_GET_FUNC_SMART_PTR(BattleLibrary, GetExperienceLibrary, const ExperienceLibrary*);
#undef SIMPLE_GET_FUNC
#undef SIMPLE_GET_FUNC
#undef SIMPLE_GET_FUNC_SMART_PTR