Adds HasVolatile functions to Angelscript Battle and BattleSide.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
2ae73b816b
commit
0623bdff06
|
@ -84,6 +84,13 @@ static CScriptHandle BattleSide_AddVolatileWrapper(CreatureLib::Battling::Battle
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool Battle_HasVolatileWrapper(PkmnLib::Battling::Battle* obj, const ArbUt::StringView& name) {
|
||||||
|
return obj->HasVolatileScript(name);
|
||||||
|
}
|
||||||
|
static bool BattleSide_HasVolatileWrapper(CreatureLib::Battling::BattleSide* obj, const ArbUt::StringView& name) {
|
||||||
|
return obj->HasVolatileScript(name);
|
||||||
|
}
|
||||||
|
|
||||||
static u8 GetPokemonIndexWrapper(CreatureLib::Battling::BattleSide* obj, PkmnLib::Battling::Pokemon* pokemon) {
|
static u8 GetPokemonIndexWrapper(CreatureLib::Battling::BattleSide* obj, PkmnLib::Battling::Pokemon* pokemon) {
|
||||||
return obj->GetCreatureIndex(pokemon);
|
return obj->GetCreatureIndex(pokemon);
|
||||||
}
|
}
|
||||||
|
@ -120,6 +127,9 @@ void RegisterBattleClass::RegisterBattleSide(asIScriptEngine* engine) {
|
||||||
asMETHODPR(CreatureLib::Battling::BattleSide, RemoveVolatileScript, (const ArbUt::BasicStringView&), void),
|
asMETHODPR(CreatureLib::Battling::BattleSide, RemoveVolatileScript, (const ArbUt::BasicStringView&), void),
|
||||||
asCALL_THISCALL);
|
asCALL_THISCALL);
|
||||||
Ensure(r >= 0);
|
Ensure(r >= 0);
|
||||||
|
r = engine->RegisterObjectMethod("BattleSide", "bool HasVolatile(const constString &in name) const",
|
||||||
|
asFUNCTION(BattleSide_HasVolatileWrapper), asCALL_CDECL_OBJFIRST);
|
||||||
|
Ensure(r >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
|
void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
|
||||||
|
@ -169,4 +179,7 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
|
||||||
r = engine->RegisterObjectMethod("Battle", "BattleParty@ FindPartyForPokemon(Pokemon@ pokemon)",
|
r = engine->RegisterObjectMethod("Battle", "BattleParty@ FindPartyForPokemon(Pokemon@ pokemon)",
|
||||||
asFUNCTION(FindPartyWrapper), asCALL_CDECL_OBJFIRST);
|
asFUNCTION(FindPartyWrapper), asCALL_CDECL_OBJFIRST);
|
||||||
Ensure(r >= 0);
|
Ensure(r >= 0);
|
||||||
|
r = engine->RegisterObjectMethod("Battle", "bool HasVolatile(const constString &in name) const",
|
||||||
|
asFUNCTION(Battle_HasVolatileWrapper), asCALL_CDECL_OBJFIRST);
|
||||||
|
Ensure(r >= 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue