Adds angelscript interface to get types of a Pokemon.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
95457d9701
commit
e39056d3d6
|
@ -70,6 +70,9 @@ static const ArbUt::StringView& GetActiveAbilityWrapper(PkmnLib::Battling::Pokem
|
||||||
return p->GetActiveTalent()->GetName();
|
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) {
|
static CScriptHandle AddVolatileWrapper(PkmnLib::Battling::Pokemon* obj, const ArbUt::StringView& name) {
|
||||||
auto handle = CScriptHandle();
|
auto handle = CScriptHandle();
|
||||||
auto* resolver = static_cast<AngelScriptResolver*>(obj->GetLibrary()->GetScriptResolver().get());
|
auto* resolver = static_cast<AngelScriptResolver*>(obj->GetLibrary()->GetScriptResolver().get());
|
||||||
|
@ -116,6 +119,12 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
|
||||||
r = engine->RegisterObjectMethod("Pokemon", "const constString& get_ActiveAbility() const property",
|
r = engine->RegisterObjectMethod("Pokemon", "const constString& get_ActiveAbility() const property",
|
||||||
asFUNCTION(GetActiveAbilityWrapper), asCALL_CDECL_OBJFIRST);
|
asFUNCTION(GetActiveAbilityWrapper), asCALL_CDECL_OBJFIRST);
|
||||||
Ensure(r >= 0);
|
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",
|
r = engine->RegisterObjectMethod("Pokemon", "void set_Height(float value) property",
|
||||||
asMETHOD(PkmnLib::Battling::Pokemon, SetHeight), asCALL_THISCALL);
|
asMETHOD(PkmnLib::Battling::Pokemon, SetHeight), asCALL_THISCALL);
|
||||||
|
|
Loading…
Reference in New Issue