diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp index b1980e8..36239fc 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterPokemonClass.cpp @@ -70,6 +70,9 @@ static const ArbUt::StringView& GetActiveAbilityWrapper(PkmnLib::Battling::Pokem return p->GetActiveTalent()->GetName(); } +static size_t GetTypesLengthWrapper(PkmnLib::Battling::Pokemon* p) { return p->GetTypes().size(); } +static uint8_t GetTypeWrapper(PkmnLib::Battling::Pokemon* p, size_t index) { return p->GetTypes()[index]; } + static CScriptHandle AddVolatileWrapper(PkmnLib::Battling::Pokemon* obj, const ArbUt::StringView& name) { auto handle = CScriptHandle(); auto* resolver = static_cast(obj->GetLibrary()->GetScriptResolver().get()); @@ -116,6 +119,12 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) { r = engine->RegisterObjectMethod("Pokemon", "const constString& get_ActiveAbility() const property", asFUNCTION(GetActiveAbilityWrapper), asCALL_CDECL_OBJFIRST); Ensure(r >= 0); + r = engine->RegisterObjectMethod("Pokemon", "uint64 get_TypesLength() const property", + asFUNCTION(GetTypesLengthWrapper), asCALL_CDECL_OBJFIRST); + Ensure(r >= 0); + r = engine->RegisterObjectMethod("Pokemon", "uint8 GetType(uint64 index) const", asFUNCTION(GetTypeWrapper), + asCALL_CDECL_OBJFIRST); + Ensure(r >= 0); r = engine->RegisterObjectMethod("Pokemon", "void set_Height(float value) property", asMETHOD(PkmnLib::Battling::Pokemon, SetHeight), asCALL_THISCALL);