Adds Getters and Setters for Weight and Height of a Pokemon in angelscript.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
6cc4206292
commit
21092eb347
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue