Adds precompiled header.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "AngelScriptResolver.hpp"
|
||||
#include <CreatureLib/Battling/Models/Creature.hpp>
|
||||
#include <cassert>
|
||||
#include <regex>
|
||||
#include "../../../extern/angelscript_addons/scripthandle/scripthandle.h"
|
||||
#include "../../../extern/angelscript_addons/scripthelper/scripthelper.h"
|
||||
@@ -74,12 +73,11 @@ void AngelScriptResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg,
|
||||
// Register Script Array type
|
||||
RegisterScriptArray(_engine, true);
|
||||
RegisterScriptHandle(_engine);
|
||||
r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL);
|
||||
if (r < 0)
|
||||
throw ArbUt::Exception("Registering print function failed.");
|
||||
}
|
||||
|
||||
r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL);
|
||||
if (r < 0)
|
||||
throw ArbUt::Exception("Registering print function failed.");
|
||||
|
||||
_builder.StartNewModule(_engine, "pkmn");
|
||||
_mainModule = _builder.GetModule();
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT
|
||||
#include <angelscript.h>
|
||||
#include <iostream>
|
||||
#include "AngelScriptScript.hpp"
|
||||
#include "AngelScriptTypeInfo.hpp"
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include <CreatureLib/Battling/ScriptHandling/Script.hpp>
|
||||
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT
|
||||
#include <angelscript.h>
|
||||
#include <cstdint>
|
||||
#include "../../../extern/angelscript_addons/scriptarray/scriptarray.h"
|
||||
#include "../../Battling/PkmnScript.hpp"
|
||||
#include "AngelScriptTypeInfo.hpp"
|
||||
|
||||
@@ -2,13 +2,8 @@
|
||||
#define PKMNLIB_ANGELSCRIPTTYPEINFO_HPP
|
||||
|
||||
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT
|
||||
#include <Arbutils/Collections/Dictionary.hpp>
|
||||
#include <Arbutils/StringView.hpp>
|
||||
#include <CreatureLib/Library/Exceptions/CreatureException.hpp>
|
||||
#include <angelscript.h>
|
||||
#include <cstring>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
|
||||
class AngelScriptTypeInfo {
|
||||
private:
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define PKMNLIB_CONTEXTPOOL_HPP
|
||||
|
||||
#include <angelscript.h>
|
||||
#include <vector>
|
||||
|
||||
class ContextPool {
|
||||
std::vector<asIScriptContext*> _pool;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "BasicScriptClass.hpp"
|
||||
#include <cassert>
|
||||
|
||||
void BasicScriptClass::Register(asIScriptEngine* engine) {
|
||||
// As far as I am aware at the moment you can't create an abstract class with virtual members through the
|
||||
@@ -46,5 +45,5 @@ shared abstract class PkmnScript {
|
||||
void DoesShareExperience(Pokemon@ faintedMon, Pokemon@ winningMon, bool& shareExperience){};
|
||||
}
|
||||
)");
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "RegisterBattleClass.hpp"
|
||||
#include <CreatureLib/Battling/Models/Battle.hpp>
|
||||
#include <cstdint>
|
||||
#include "../../../../Battling/Battle/Battle.hpp"
|
||||
#include "../HelperFile.hpp"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterBattleLibrary.hpp"
|
||||
#include <cassert>
|
||||
#include "../../../../Battling/Library/BattleLibrary.hpp"
|
||||
|
||||
void RegisterBattleLibrary::Register(asIScriptEngine* engine) {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterExecutingAttack.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <CreatureLib/Battling/Models/ExecutingAttack.hpp>
|
||||
#include "../HelperFile.hpp"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterPokemonClass.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <CreatureLib/Battling/Models/LearnedAttack.hpp>
|
||||
#include "../../../../../extern/angelscript_addons/scriptarray/scriptarray.h"
|
||||
#include "../../../../Battling/PkmnDamageSource.hpp"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "ConstString.hpp"
|
||||
#include <Arbutils/StringView.hpp>
|
||||
|
||||
static void ConstructConstString(void* self) { new (self) ArbUt::StringView(); }
|
||||
static void ConstructConstStringFromStd(void* self, const std::string& s) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#ifndef PKMNLIB_CONSTSTRING_HPP
|
||||
#define PKMNLIB_CONSTSTRING_HPP
|
||||
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <angelscript.h>
|
||||
|
||||
class ConstStringRegister {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterEffectParameter.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <CreatureLib/Library/EffectParameter.hpp>
|
||||
|
||||
static CreatureLib::Library::EffectParameter* Ref_Factory() { return new CreatureLib::Library::EffectParameter(); }
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "RegisterGrowthRateTypes.hpp"
|
||||
#include <CreatureLib/Library/GrowthRates/GrowthRate.hpp>
|
||||
#include <CreatureLib/Library/GrowthRates/GrowthRateLibrary.hpp>
|
||||
#include <cassert>
|
||||
|
||||
void RegisterGrowthRateTypes::Register(asIScriptEngine* engine) {
|
||||
RegisterGrowthRateType(engine);
|
||||
@@ -9,13 +8,13 @@ void RegisterGrowthRateTypes::Register(asIScriptEngine* engine) {
|
||||
}
|
||||
void RegisterGrowthRateTypes::RegisterGrowthRateType(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("GrowthRate", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("GrowthRate", "uint8 CalculateLevel(uint experience) const",
|
||||
asMETHOD(CreatureLib::Library::GrowthRate, CalculateLevel), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("GrowthRate", "uint CalculateExperience(uint8 level) const",
|
||||
asMETHOD(CreatureLib::Library::GrowthRate, CalculateExperience), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
|
||||
static uint8_t CalculateLevel(const CreatureLib::Library::GrowthRateLibrary* obj, const ArbUt::StringView& str,
|
||||
@@ -29,13 +28,13 @@ static uint32_t CalculateExperience(const CreatureLib::Library::GrowthRateLibrar
|
||||
|
||||
void RegisterGrowthRateTypes::RegisterGrowthRateLibrary(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("GrowthRateLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("GrowthRateLibrary",
|
||||
"uint8 CalculateLevel(const constString &in growthRate, uint experience) const",
|
||||
asFUNCTION(CalculateLevel), asCALL_CDECL_OBJLAST);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod(
|
||||
"GrowthRateLibrary", "uint CalculateExperience(const constString &in growthRate, uint8 experience) const",
|
||||
asFUNCTION(CalculateExperience), asCALL_CDECL_OBJLAST);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterItemTypes.hpp"
|
||||
#include <cassert>
|
||||
#include "../../../../Library/Items/Item.hpp"
|
||||
#include "../../../../Library/Items/ItemLibrary.hpp"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterSpeciesTypes.hpp"
|
||||
#include <cassert>
|
||||
#include "../../../../Library/Species/PokemonSpecies.hpp"
|
||||
#include "../../../../Library/Species/SpeciesLibrary.hpp"
|
||||
#include "../../../../Library/Statistic.hpp"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "RegisterStaticLibraryTypes.hpp"
|
||||
#include <cassert>
|
||||
#include "../../../../Library/PokemonLibrary.hpp"
|
||||
#include "../HelperFile.hpp"
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "RegisterTypeLibrary.hpp"
|
||||
#include <CreatureLib/Library/TypeLibrary.hpp>
|
||||
#include <cassert>
|
||||
|
||||
void RegisterTypeLibrary::Register(asIScriptEngine* engine) { RegisterTypeLibraryType(engine); }
|
||||
|
||||
@@ -10,13 +9,13 @@ static bool GetTypeId(const CreatureLib::Library::TypeLibrary* obj, const ArbUt:
|
||||
|
||||
void RegisterTypeLibrary::RegisterTypeLibraryType(asIScriptEngine* engine) {
|
||||
[[maybe_unused]] int r = engine->RegisterObjectType("TypeLibrary", 0, asOBJ_REF | asOBJ_NOCOUNT);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod("TypeLibrary", "uint8 GetTypeId(const constString &in name) const",
|
||||
asFUNCTION(GetTypeId), asCALL_CDECL_OBJLAST);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
r = engine->RegisterObjectMethod(
|
||||
"TypeLibrary", "float GetSingleEffectiveness(uint8 attacking, uint8 defensive) const",
|
||||
asMETHOD(CreatureLib::Library::TypeLibrary, GetSingleEffectiveness), asCALL_THISCALL);
|
||||
assert(r >= 0);
|
||||
Assert(r >= 0);
|
||||
// TODO: Register get full effectiveness method.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user