PkmnLib/CInterface/Library/Nature.cpp

24 lines
1.2 KiB
C++
Raw Normal View History

2020-04-17 18:15:21 +00:00
#include "../../src/Library/Natures/Nature.hpp"
#include "../Core.hpp"
using namespace PkmnLib::Library;
2020-04-28 12:48:56 +00:00
export Nature* PkmnLib_Nature_Construct(CreatureLib::Library::Statistic increasedStat,
CreatureLib::Library::Statistic decreasedStat, float increasedModifier,
float decreasedModifier) {
2020-04-17 18:15:21 +00:00
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
2020-04-28 12:48:56 +00:00
export float PkmnLib_Nature_GetStatModifier(PkmnLib::Library::Nature nature, CreatureLib::Library::Statistic stat) {
2020-04-17 18:15:21 +00:00
return nature.GetStatModifier(stat);
}