Update to newest version of CreatureLib, added ChoiceQueue in AngelScript.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-02-22 15:22:13 +01:00
parent b1f101d646
commit 904af99022
3 changed files with 20 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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: