Adds Getters and Setters for Weight and Height of a Pokemon in angelscript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-10-30 17:11:26 +02:00
parent 6cc4206292
commit 21092eb347
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 11 additions and 2 deletions

View File

@ -106,8 +106,17 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
REGISTER_GETTER("Pokemon", "const narray<LearnedMove@>@ get_Moves() const property", PkmnLib::Battling::Pokemon,
GetMoves);
auto r = engine->RegisterObjectMethod("Pokemon", "bool HasHeldItem(const constString &in name) const",
asFUNCTION(HasHeldItem), asCALL_CDECL_OBJFIRST);
REGISTER_GETTER("Pokemon", "float get_Weight() const property", CreatureLib::Battling::Creature, GetWeight);
REGISTER_GETTER("Pokemon", "float get_Height() const property", CreatureLib::Battling::Creature, GetHeight);
auto r = engine->RegisterObjectMethod("Pokemon", "void set_Weight(float value) const property",
asMETHOD(PkmnLib::Battling::Pokemon, SetWeight), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "void set_Height(float value) const property",
asMETHOD(PkmnLib::Battling::Pokemon, SetHeight), asCALL_THISCALL);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "bool HasHeldItem(const constString &in name) const",
asFUNCTION(HasHeldItem), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("Pokemon", "void SetHeldItem(const constString &in name)",
asFUNCTION(SetHeldItemWrapper), asCALL_CDECL_OBJFIRST);