Fixes build failures in Angelscript
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Deukhoofd 2022-05-14 11:59:54 +02:00
parent e32d655d80
commit 50c58a9fd3
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
12 changed files with 17 additions and 12 deletions

View File

@ -22,6 +22,11 @@ static bool HasFlag(const PkmnLib::Library::MoveData* obj, const ArbUt::BasicStr
return obj->HasFlag(str);
}
static bool GetMove(const PkmnLib::Library::MoveLibrary* obj, const ArbUt::BasicStringView& str) {
return obj->Get(str);
}
void RegisterMoveTypes::RegisterMoveType(asIScriptEngine* engine) {
int r = engine->RegisterObjectType("MoveData", 0, asOBJ_REF | asOBJ_NOCOUNT);
Ensure(r >= 0);
@ -46,7 +51,7 @@ void RegisterMoveTypes::RegisterMoveLibrary(asIScriptEngine* engine) {
int r = engine->RegisterObjectType("MoveLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
Ensure(r >= 0);
r = engine->RegisterObjectMethod("MoveLibrary", "const MoveData@ Get(const constString &in name) const",
asMETHOD(PkmnLib::Library::MoveLibrary, Get), asCALL_THISCALL);
asFUNCTION(GetMove), asCALL_CDECL_OBJFIRST);
Ensure(r >= 0);
}

View File

@ -3,7 +3,7 @@
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
#include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../TestLibrary/TestLibrary.hpp"
#include "../../TestLibrary/TestLibrary.hpp"
#define AS_CLASS(name, contents) \
{ \

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
#include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../TestLibrary/TestLibrary.hpp"
#include "../../TestLibrary/TestLibrary.hpp"
#define AS_CLASS(name, contents) \
{ #name, "namespace Pokemon{ [ItemUse effect=" #name "] class " #name " : ItemUseScript { " contents "}}" }

View File

@ -3,7 +3,7 @@
#include "../../src/Battling/Pokemon/CreatePokemon.hpp"
#include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../TestLibrary/TestLibrary.hpp"
#include "../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"basic_ownership_test",

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../TestLibrary/TestLibrary.hpp"
#include "../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -4,7 +4,7 @@
#include "../../../../src/Battling/Pokemon/CreatePokemon.hpp"
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -3,7 +3,7 @@
#include "../../../../src/Battling/Pokemon/CreatePokemon.hpp"
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(

View File

@ -2,7 +2,7 @@
#include <doctest.h>
#include "../../../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
#include "../../../../src/ScriptResolving/AngelScript/ContextPool.hpp"
#include "../../../TestLibrary/TestLibrary.hpp"
#include "../../../../TestLibrary/TestLibrary.hpp"
static std::unordered_map<const char*, const char*> _scripts =
std::unordered_map<const char*, const char*>{{"testScript1", R"(