Update to newest version of CreatureLib, added ChoiceQueue in AngelScript.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -4,9 +4,24 @@
|
||||
#include <cstdint>
|
||||
|
||||
void RegisterBattleClass::Register(asIScriptEngine* engine) {
|
||||
RegisterChoiceQueue(engine);
|
||||
RegisterBattleRandom(engine);
|
||||
RegisterBattle(engine);
|
||||
}
|
||||
|
||||
void RegisterBattleClass::RegisterChoiceQueue(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("ChoiceQueue", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("ChoiceQueue", "bool MovePokemonChoiceNext(Pokemon@ target)",
|
||||
asMETHOD(CreatureLib::Battling::ChoiceQueue, MoveCreatureChoiceNext),
|
||||
asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("ChoiceQueue", "BaseTurnChoice Peek() const",
|
||||
asMETHOD(CreatureLib::Battling::ChoiceQueue, Peek),
|
||||
asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
}
|
||||
|
||||
void RegisterBattleClass::RegisterBattleRandom(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("BattleRandom", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
@@ -43,4 +58,7 @@ void RegisterBattleClass::RegisterBattle(asIScriptEngine* engine) {
|
||||
r = engine->RegisterObjectMethod("Battle", "BattleRandom@ get_Random() const property",
|
||||
asMETHOD(CreatureLib::Battling::Battle, GetRandom), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("Battle", "ChoiceQueue@ get_TurnQueue() const property",
|
||||
asMETHOD(CreatureLib::Battling::Battle, GetCurrentTurnQueue), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <angelscript.h>
|
||||
class RegisterBattleClass {
|
||||
static void RegisterChoiceQueue(asIScriptEngine* engine);
|
||||
static void RegisterBattle(asIScriptEngine* engine);
|
||||
static void RegisterBattleRandom(asIScriptEngine* engine);
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user