Ensure AngelScript allows resolving PkmnScriptCategory categories.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-18 16:04:48 +02:00
parent c6d31e09a1
commit 6955c2c69f
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "../../../extern/angelscript_addons/scripthandle/scripthandle.h"
#include "../../../extern/angelscript_addons/scripthelper/scripthelper.h"
#include "../../../extern/angelscript_addons/scriptstdstring/scriptstdstring.h"
#include "../../Battling/PkmnScriptCategory.hpp"
#include "ByteCodeHandling/FileByteCodeStream.hpp"
#include "ByteCodeHandling/MemoryByteCodeStream.hpp"
#include "TypeRegistry/BasicScriptClass.hpp"
@ -43,6 +44,9 @@ void AngelScripResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg) {
for (auto scriptCategory : ScriptCategoryHelper::GetValues()) {
_typeDatabase.Insert(scriptCategory, {});
}
for (auto scriptCategory : PkmnScriptCategoryHelper::GetValues()) {
_typeDatabase.Insert(static_cast<ScriptCategory>(scriptCategory), {});
}
auto library = (PkmnLib::Battling::BattleLibrary*)arg;
_engine = asCreateScriptEngine();
@ -186,6 +190,9 @@ void AngelScripResolver::FinalizeModule() {
} else if (metadataKind == "Side") {
_typeDatabase[ScriptCategory::Side].Insert(effectName,
new AngelScriptTypeInfo(effectName, typeInfo));
} else if (metadataKind == "Weather") {
_typeDatabase[static_cast<ScriptCategory>(PkmnScriptCategory::Weather)].Insert(effectName,
new AngelScriptTypeInfo(effectName, typeInfo));
}
}
}