C Interface for nature.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-17 20:15:21 +02:00
parent bd3e274d3d
commit a95b6d1817
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#include "../../src/Library/Natures/Nature.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Library;
export Nature* PkmnLib_Nature_Construct(CreatureLib::Library::Statistic increasedStat, CreatureLib::Library::Statistic decreasedStat,
float increasedModifier, float decreasedModifier) {
return new Nature(increasedStat, decreasedStat, increasedModifier, decreasedModifier);
}
export void PkmnLib_Nature_Destruct(const Nature* p) { delete p; }
#define SIMPLE_GET_FUNC(type, name, returnType) \
export returnType PkmnLib_##type##_##name(const PkmnLib::Library::type* p) { return p->name(); }
SIMPLE_GET_FUNC(Nature, GetIncreaseModifier, float)
SIMPLE_GET_FUNC(Nature, GetDecreaseModifier, float)
SIMPLE_GET_FUNC(Nature, GetIncreasedStat, CreatureLib::Library::Statistic)
SIMPLE_GET_FUNC(Nature, GetDecreasedStat, CreatureLib::Library::Statistic)
#undef SIMPLE_GET_FUNC
export float PkmnLib_Nature_GetStatModifier(PkmnLib::Library::Nature nature, CreatureLib::Library::Statistic stat){
return nature.GetStatModifier(stat);
}