2020-04-17 19:02:17 +00:00
|
|
|
#include "../../src/Library/Items/Item.hpp"
|
|
|
|
#include <Arbutils/ConstString.hpp>
|
|
|
|
#include "../Core.hpp"
|
|
|
|
using namespace PkmnLib::Library;
|
|
|
|
|
|
|
|
export Item* PkmnLib_Item_Construct(const char* name, CreatureLib::Library::ItemCategory category,
|
|
|
|
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
|
|
|
|
const char* flags[], size_t flagsCount, uint8_t flingPower) {
|
|
|
|
std::unordered_set<uint32_t> conversedFlags(flagsCount);
|
|
|
|
for (size_t i = 0; i < flagsCount; i++) {
|
2020-05-27 15:26:25 +00:00
|
|
|
conversedFlags.insert(ArbUt::CaseInsensitiveConstString::GetHash(flags[i]));
|
2020-04-17 19:02:17 +00:00
|
|
|
}
|
|
|
|
|
2020-05-27 15:26:25 +00:00
|
|
|
return new Item(ArbUt::CaseInsensitiveConstString(name), category, battleCategory, price, conversedFlags,
|
2020-04-17 19:02:17 +00:00
|
|
|
flingPower);
|
|
|
|
};
|
|
|
|
|
|
|
|
export void PkmnLib_Item_Destruct(const Item* 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(Item, GetFlingPower, uint8_t)
|
|
|
|
|
|
|
|
#undef SIMPLE_GET_FUNC
|