This commit is contained in:
@@ -61,21 +61,6 @@ void RegisterPokemonClass::RegisterLearnedAttack(asIScriptEngine* engine) {
|
||||
|
||||
ENUM__SIZE_WRAPPER(Pkmn_GenderWrapper, PkmnLib::Battling::Pokemon, GetGender)
|
||||
|
||||
CScriptArray* GetTypes(const PkmnLib::Battling::Pokemon* obj) {
|
||||
asIScriptContext* ctx = asGetActiveContext();
|
||||
if (ctx) {
|
||||
asIScriptEngine* engine = ctx->GetEngine();
|
||||
asITypeInfo* t = engine->GetTypeInfoByDecl("array<uint8>");
|
||||
auto a = obj->GetTypes();
|
||||
CScriptArray* arr = CScriptArray::Create(t, a.Count());
|
||||
for (size_t i = 0; i < a.Count(); i++) {
|
||||
arr->SetValue(i, &a[i]);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CScriptArray* GetMoves(const PkmnLib::Battling::Pokemon* obj) {
|
||||
asIScriptContext* ctx = asGetActiveContext();
|
||||
if (ctx) {
|
||||
@@ -150,9 +135,6 @@ void RegisterPokemonClass::RegisterPokemonType(asIScriptEngine* engine) {
|
||||
r = engine->RegisterObjectMethod("Pokemon", "bool get_IsFainted() const property",
|
||||
asMETHOD(PkmnLib::Battling::Pokemon, IsFainted), asCALL_THISCALL);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Pokemon", "uint8[]@ GetTypes() const", asFUNCTION(GetTypes),
|
||||
asCALL_CDECL_OBJLAST);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Pokemon", "bool HasType(uint8 type) const",
|
||||
asMETHOD(PkmnLib::Battling::Pokemon, HasType), asCALL_THISCALL);
|
||||
Assert(r >= 0);
|
||||
|
||||
Reference in New Issue
Block a user