39 lines
2.3 KiB
C++
39 lines
2.3 KiB
C++
#include "RegisterBattleLibrary.hpp"
|
|
#include <cassert>
|
|
#include "../../../../Battling/Library/BattleLibrary.hpp"
|
|
|
|
void RegisterBattleLibrary::Register(asIScriptEngine* engine) {
|
|
RegisterDamageLibrary(engine);
|
|
RegisterLibrary(engine);
|
|
}
|
|
void RegisterBattleLibrary::RegisterDamageLibrary(asIScriptEngine* engine) {
|
|
[[maybe_unused]] int r = engine->RegisterObjectType("DamageLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("DamageLibrary", "int GetDamage() const",
|
|
asMETHOD(PkmnLib::Battling::DamageLibrary, GetDamage), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
}
|
|
|
|
void RegisterBattleLibrary::RegisterLibrary(asIScriptEngine* engine) {
|
|
[[maybe_unused]] int r = engine->RegisterObjectType("BattleLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const LibrarySettings@ get_Settings() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetSettings), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const StaticLibrary@ get_StaticLibrary() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetStaticLib), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const SpeciesLibrary@ get_SpeciesLibrary() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetSpeciesLibrary), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const MoveLibrary@ get_MoveLibrary() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetMoveLibrary), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const ItemLibrary@ get_ItemLibrary() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetItemLibrary), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
r = engine->RegisterObjectMethod("BattleLibrary", "const DamageLibrary@ get_DamageLibrary() const property",
|
|
asMETHOD(PkmnLib::Battling::BattleLibrary, GetDamageLibrary), asCALL_THISCALL);
|
|
assert(r >= 0);
|
|
}
|