Adds precompiled header.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fda3c8f86d
commit
2ce766f589
|
@ -84,6 +84,7 @@ endif ()
|
|||
|
||||
file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE})
|
||||
add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES})
|
||||
target_precompile_headers(pkmnLib PUBLIC src/Precompiled.hxx)
|
||||
|
||||
SET(_LINKS CreatureLib Arbutils)
|
||||
SET(_TESTLINKS pkmnLib CreatureLib Arbutils)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef PKMNLIB_PKMNEVENTKIND_HPP
|
||||
#define PKMNLIB_PKMNEVENTKIND_HPP
|
||||
#include <Arbutils/Enum.hpp>
|
||||
#include <CreatureLib/Battling/EventHooks/EventDataKind.hpp>
|
||||
|
||||
ENUM_WITH_START_VALUE(PkmnEventDataKind, uint8_t, 128, WeatherChange, StatusChange)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef PKMNLIB_STATUSCHANGEEVENT_HPP
|
||||
#define PKMNLIB_STATUSCHANGEEVENT_HPP
|
||||
|
||||
#include <Arbutils/String/StringView.hpp>
|
||||
#include <CreatureLib/Battling/EventHooks/Events/EventData.hpp>
|
||||
#include "../Pokemon/Pokemon.hpp"
|
||||
#include "PkmnEventKind.hpp"
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef PKMNLIB_WEATHERCHANGEEVENT_HPP
|
||||
#define PKMNLIB_WEATHERCHANGEEVENT_HPP
|
||||
#include <Arbutils/StringView.hpp>
|
||||
#include <CreatureLib/Battling/EventHooks/Events/EventData.hpp>
|
||||
#include "PkmnEventKind.hpp"
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define PKMNLIB_BATTLELIBRARY_HPP
|
||||
|
||||
#include <CreatureLib/Battling/Library/BattleLibrary.hpp>
|
||||
#include <memory>
|
||||
#include "../../Library/PokemonLibrary.hpp"
|
||||
#include "DamageLibrary.hpp"
|
||||
#include "ExperienceLibrary.hpp"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef PKMNLIB_PKMNDAMAGESOURCE_HPP
|
||||
#define PKMNLIB_PKMNDAMAGESOURCE_HPP
|
||||
|
||||
#include <Arbutils/Enum.hpp>
|
||||
#include <CreatureLib/Battling/Models/DamageSource.hpp>
|
||||
|
||||
ENUM_WITH_START_VALUE(PkmnDamageSource, uint8_t, ((uint8_t)CreatureLib::Battling::DamageSourceHelper::Highest()) + 1,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef PKMNLIB_PKMNSCRIPTCATEGORY_HPP
|
||||
#define PKMNLIB_PKMNSCRIPTCATEGORY_HPP
|
||||
#include <Arbutils/Enum.hpp>
|
||||
#include <CreatureLib/Battling/ScriptHandling/ScriptCategory.hpp>
|
||||
|
||||
ENUM_WITH_START_VALUE(PkmnScriptCategory, uint8_t, 128, Weather, Status)
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef PKMNLIB_CREATEPOKEMON_HPP
|
||||
#define PKMNLIB_CREATEPOKEMON_HPP
|
||||
|
||||
#include <utility>
|
||||
#include "Pokemon.hpp"
|
||||
namespace PkmnLib::Battling {
|
||||
class CreatePokemon {
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define PKMNLIB_POKEMON_HPP
|
||||
|
||||
#include <CreatureLib/Battling/Models/Creature.hpp>
|
||||
#include <utility>
|
||||
#include "../../Library/Statistic.hpp"
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
#include "LearnedMove.hpp"
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define PKMNLIB_POKEMONPARTY_HPP
|
||||
|
||||
#include <CreatureLib/Battling/Models/CreatureParty.hpp>
|
||||
#include <utility>
|
||||
#include "Pokemon.hpp"
|
||||
namespace PkmnLib::Battling {
|
||||
class PokemonParty : public CreatureLib::Battling::CreatureParty {
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
#ifndef PKMNLIB_EVOLUTIONDATA_HPP
|
||||
#define PKMNLIB_EVOLUTIONDATA_HPP
|
||||
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||
#include <Arbutils/Memory/UniquePtrList.hpp>
|
||||
#include <CreatureLib/Library/EffectParameter.hpp>
|
||||
#include <CreatureLib/Library/Gender.hpp>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include "../TimeOfDay.hpp"
|
||||
#include "EvolutionMethod.hpp"
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef PKMNLIB_EVOLUTIONMETHOD_HPP
|
||||
#define PKMNLIB_EVOLUTIONMETHOD_HPP
|
||||
|
||||
#include <cstdint>
|
||||
namespace PkmnLib::Library {
|
||||
ENUM(EvolutionMethod, uint8_t, Level, HighFriendship, KnownMove, LocationBased, TimeBased, HoldsItem,
|
||||
IsGenderAndLevel, EvolutionItemUse, EvolutionItemUseWithGender, Trade, TradeWithHeldItem,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef PKMNLIB_MOVECATEGORY_HPP
|
||||
#define PKMNLIB_MOVECATEGORY_HPP
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
enum class MoveCategory : uint8_t { Physical, Special, Status };
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "MoveData.hpp"
|
||||
#include <utility>
|
||||
PkmnLib::Library::MoveData::MoveData(const ArbUt::StringView& name, uint8_t type,
|
||||
PkmnLib::Library::MoveCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, CreatureLib::Library::AttackTarget target, int8_t priority,
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
#ifndef PKMNLIB_NATURELIBRARY_HPP
|
||||
#define PKMNLIB_NATURELIBRARY_HPP
|
||||
|
||||
#include <Arbutils/Collections/Dictionary.hpp>
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||
#include <Arbutils/Random.hpp>
|
||||
#include <Arbutils/StringView.hpp>
|
||||
#include <CreatureLib/Library/Exceptions/CreatureException.hpp>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "Nature.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef PKMNLIB_LEARNABLEMOVES_HPP
|
||||
#define PKMNLIB_LEARNABLEMOVES_HPP
|
||||
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||
#include <CreatureLib/Library/CreatureData/LearnableAttacks.hpp>
|
||||
#include "../Moves/MoveData.hpp"
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "PokemonForme.hpp"
|
||||
#include <utility>
|
||||
PkmnLib::Library::PokemonForme::PokemonForme(const ArbUt::StringView& name, float height, float weight,
|
||||
uint32_t baseExperience, const ArbUt::List<uint8_t>& types,
|
||||
CreatureLib::Library::StatisticSet<uint16_t> baseStats,
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define PKMNLIB_POKEMONFORME_HPP
|
||||
|
||||
#include <CreatureLib/Library/CreatureData/SpeciesVariant.hpp>
|
||||
#include <cstdint>
|
||||
#include "LearnableMoves.hpp"
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef PKMNLIB_POKEMONSPECIES_HPP
|
||||
#define PKMNLIB_POKEMONSPECIES_HPP
|
||||
#include <Arbutils/Memory/UniquePtrList.hpp>
|
||||
#include <CreatureLib/Battling/Models/Creature.hpp>
|
||||
#include "../Evolutions/EvolutionData.hpp"
|
||||
#include "PokemonForme.hpp"
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
#ifndef PKMNLIB_TIMEOFDAY_HPP
|
||||
#define PKMNLIB_TIMEOFDAY_HPP
|
||||
|
||||
#include <Arbutils/Enum.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
namespace PkmnLib::Library {
|
||||
ENUM(TimeOfDay, uint8_t, Night, Morning, Afternoon, Evening)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef PKMNLIB_PRECOMPILED_HXX
|
||||
#define PKMNLIB_PRECOMPILED_HXX
|
||||
|
||||
#include <CreatureLib/Precompiled.hxx>
|
||||
|
||||
#endif // PKMNLIB_PRECOMPILED_HXX
|
|
@ -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.
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue