Enable pedantic errors
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
3739b0bb66
commit
a6b1c8a8ec
|
@ -1,56 +1,56 @@
|
|||
#include "../../src/ScriptResolving/AngelScript/AngelScriptResolver.hpp"
|
||||
#include "../Core.hpp"
|
||||
|
||||
export AngelScriptResolver* PkmnLib_AngelScriptResolver_Construct() { return new AngelScriptResolver(); }
|
||||
export uint8_t PkmnLib_AngelScriptResolver_Destruct(AngelScriptResolver* p) { Try(delete p;) }
|
||||
export_func AngelScriptResolver* PkmnLib_AngelScriptResolver_Construct() { return new AngelScriptResolver(); }
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_Destruct(AngelScriptResolver* p) { Try(delete p;) }
|
||||
|
||||
export uint8_t PkmnLib_AngelScriptResolver_Initialize(AngelScriptResolver* p,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_Initialize(AngelScriptResolver* p,
|
||||
CreatureLib::Battling::BattleLibrary* lib) {
|
||||
Try(p->Initialize(lib);)
|
||||
}
|
||||
|
||||
export uint8_t PkmnLib_AngelScriptResolver_CreateScript(AngelScriptResolver* p, const char* name, const char* script) {
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_CreateScript(AngelScriptResolver* p, const char* name, const char* script) {
|
||||
Try(p->CreateScript(name, script);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_FinalizeModule(AngelScriptResolver* p) { Try(p->FinalizeModule();) }
|
||||
export uint8_t PkmnLib_AngelScriptResolver_LoadScript(CreatureLib::Battling::BattleScript*& out, AngelScriptResolver* p,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_FinalizeModule(AngelScriptResolver* p) { Try(p->FinalizeModule();) }
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_LoadScript(CreatureLib::Battling::BattleScript*& out, AngelScriptResolver* p,
|
||||
void* owner, ScriptCategory category, const char* scriptName) {
|
||||
Try(out = p->LoadScript(owner, category, ArbUt::StringView(scriptName));)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_LoadEvolutionScript(PkmnLib::Battling::EvolutionScript const*& out,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_LoadEvolutionScript(PkmnLib::Battling::EvolutionScript const*& out,
|
||||
AngelScriptResolver* p, const char* scriptName) {
|
||||
Try(
|
||||
auto s = p->LoadEvolutionScript(ArbUt::StringView(scriptName));
|
||||
if (!s.HasValue()) { out = nullptr; } else { out = s.GetValue(); })
|
||||
}
|
||||
|
||||
export uint8_t PkmnLib_AngelScriptResolver_WriteByteCodeToFile(AngelScriptResolver* p, const char* file,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_WriteByteCodeToFile(AngelScriptResolver* p, const char* file,
|
||||
bool stripDebugInfo) {
|
||||
Try(p->WriteByteCodeToFile(file, stripDebugInfo);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_LoadByteCodeFromFile(AngelScriptResolver* p, const char* file) {
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_LoadByteCodeFromFile(AngelScriptResolver* p, const char* file) {
|
||||
Try(p->LoadByteCodeFromFile(file);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_WriteByteCodeToMemory(AngelScriptResolver* p, bool stripDebugInfo,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_WriteByteCodeToMemory(AngelScriptResolver* p, bool stripDebugInfo,
|
||||
size_t& size, uint8_t*& out) {
|
||||
Try(out = p->WriteByteCodeToMemory(size, stripDebugInfo);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_LoadByteCodeFromMemory(AngelScriptResolver* p, uint8_t* memory,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_LoadByteCodeFromMemory(AngelScriptResolver* p, uint8_t* memory,
|
||||
size_t size) {
|
||||
Try(p->LoadByteCodeFromMemory(memory, size);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_RegisterType(AngelScriptResolver* p, const char* typeName) {
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_RegisterType(AngelScriptResolver* p, const char* typeName) {
|
||||
Try(p->RegisterType(typeName);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_RegisterTypeMethod(AngelScriptResolver* p, const char* typeName,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_RegisterTypeMethod(AngelScriptResolver* p, const char* typeName,
|
||||
const char* decl, void*(func)(void*)) {
|
||||
Try(p->RegisterTypeMethod(typeName, decl, func);)
|
||||
}
|
||||
export uint8_t PkmnLib_AngelScriptResolver_RegisterGlobalMethod(AngelScriptResolver* p, const char* decl,
|
||||
export_func uint8_t PkmnLib_AngelScriptResolver_RegisterGlobalMethod(AngelScriptResolver* p, const char* decl,
|
||||
void*(func)(void*)) {
|
||||
Try(p->RegisterGlobalMethod(decl, func);)
|
||||
}
|
||||
export void PkmnLib_AngelScriptResolver_DefineWord(AngelScriptResolver* p, const char* word) { p->DefineWord(word); }
|
||||
export_func void PkmnLib_AngelScriptResolver_DefineWord(AngelScriptResolver* p, const char* word) { p->DefineWord(word); }
|
||||
|
||||
#ifdef ANGELSCRIPT_DEBUGGER
|
||||
export void PkmnLib_AngelScriptResolver_AddDebugger(AngelScriptResolver* p, u16 port) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "../../src/ScriptResolving/AngelScript/AngelScriptScript.hpp"
|
||||
#include "../Core.hpp"
|
||||
|
||||
export uint8_t PkmnLib_AngelscriptScript_Destruct(AngelScriptScript* p) { Try(delete p;) }
|
||||
export_func uint8_t PkmnLib_AngelscriptScript_Destruct(AngelScriptScript* p) { Try(delete p;) }
|
|
@ -2,7 +2,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export uint8_t PkmnLib_Battle_Construct(Battle*& out, const BattleLibrary* library,
|
||||
export_func uint8_t PkmnLib_Battle_Construct(Battle*& out, const BattleLibrary* library,
|
||||
CreatureLib::Battling::BattleParty* const* parties, size_t partiesCount,
|
||||
bool canFlee, uint8_t numberOfSides, uint8_t creaturesPerSide,
|
||||
uint_fast32_t randomSeed) {
|
||||
|
@ -10,7 +10,7 @@ export uint8_t PkmnLib_Battle_Construct(Battle*& out, const BattleLibrary* libra
|
|||
Try(out = new Battle(library, partiesList, canFlee, numberOfSides, creaturesPerSide, randomSeed));
|
||||
}
|
||||
|
||||
export void PkmnLib_Battle_Destruct(Battle* p) { p->~Battle(); }
|
||||
export uint8_t PkmnLib_Battle_SetWeather(Battle* p, const char* name) { Try(p->SetWeather(ArbUt::StringView(name))); };
|
||||
export uint8_t PkmnLib_Battle_ClearWeather(Battle* p) { Try(p->ClearWeather()); };
|
||||
export const char* PkmnLib_Battle_GetWeatherName(Battle* p) { return p->GetWeatherName().c_str(); }
|
||||
export_func void PkmnLib_Battle_Destruct(Battle* p) { p->~Battle(); }
|
||||
export_func uint8_t PkmnLib_Battle_SetWeather(Battle* p, const char* name) { Try(p->SetWeather(ArbUt::StringView(name))); };
|
||||
export_func uint8_t PkmnLib_Battle_ClearWeather(Battle* p) { Try(p->ClearWeather()); };
|
||||
export_func const char* PkmnLib_Battle_GetWeatherName(Battle* p) { return p->GetWeatherName().c_str(); }
|
|
@ -2,7 +2,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export uint8_t PkmnLib_BattleLibrary_Construct(BattleLibrary*& out, PkmnLib::Library::PokemonLibrary* staticLib,
|
||||
export_func uint8_t PkmnLib_BattleLibrary_Construct(BattleLibrary*& out, PkmnLib::Library::PokemonLibrary* staticLib,
|
||||
StatCalculator* statCalculator, DamageLibrary* damageLibrary,
|
||||
ExperienceLibrary* experienceLibrary,
|
||||
PkmnLib::Battling::ScriptResolver* scriptResolver,
|
||||
|
@ -11,7 +11,7 @@ export uint8_t PkmnLib_BattleLibrary_Construct(BattleLibrary*& out, PkmnLib::Lib
|
|||
miscLibrary, captureLibrary));
|
||||
}
|
||||
|
||||
export void PkmnLib_BattleLibrary_Destruct(BattleLibrary* p) { delete p; }
|
||||
export_func void PkmnLib_BattleLibrary_Destruct(BattleLibrary* p) { delete p; }
|
||||
|
||||
export uint8_t PkmnLib_CaptureLibrary_Construct(CaptureLibrary*& out) { Try(out = new CaptureLibrary()); }
|
||||
export void PkmnLib_CaptureLibrary_Destruct(CaptureLibrary* p) { delete p; }
|
||||
export_func uint8_t PkmnLib_CaptureLibrary_Construct(CaptureLibrary*& out) { Try(out = new CaptureLibrary()); }
|
||||
export_func void PkmnLib_CaptureLibrary_Destruct(CaptureLibrary* p) { delete p; }
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export DamageLibrary* PkmnLib_DamageLibrary_Construct() { return new DamageLibrary(); }
|
||||
export_func DamageLibrary* PkmnLib_DamageLibrary_Construct() { return new DamageLibrary(); }
|
||||
|
||||
export void PkmnLib_DamageLibrary_Destruct(DamageLibrary* p) { delete p; }
|
||||
export_func void PkmnLib_DamageLibrary_Destruct(DamageLibrary* p) { delete p; }
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export void PkmnLib_WeatherChangeEvent_Destruct(WeatherChangeEvent* p) { delete p; }
|
||||
export const char* PkmnLib_WeatherChangeEvent_GetWeatherName(WeatherChangeEvent* p) {
|
||||
export_func void PkmnLib_WeatherChangeEvent_Destruct(WeatherChangeEvent* p) { delete p; }
|
||||
export_func const char* PkmnLib_WeatherChangeEvent_GetWeatherName(WeatherChangeEvent* p) {
|
||||
return p->GetWeatherName().c_str();
|
||||
}
|
||||
|
||||
export void PkmnLib_CaptureAttemptEvent_Destruct(CaptureAttemptEvent* p) { delete p; }
|
||||
export const PkmnLib::Battling::Pokemon* PkmnLib_CaptureAttemptEvent_GetPokemon(CaptureAttemptEvent* p) {
|
||||
export_func void PkmnLib_CaptureAttemptEvent_Destruct(CaptureAttemptEvent* p) { delete p; }
|
||||
export_func const PkmnLib::Battling::Pokemon* PkmnLib_CaptureAttemptEvent_GetPokemon(CaptureAttemptEvent* p) {
|
||||
return p->GetPokemon();
|
||||
}
|
||||
export const PkmnLib::Battling::CaptureLibrary::CaptureResult
|
||||
export_func const PkmnLib::Battling::CaptureLibrary::CaptureResult
|
||||
PkmnLib_CaptureAttemptEvent_GetResult(CaptureAttemptEvent* p) {
|
||||
return p->GetResult();
|
||||
}
|
|
@ -2,9 +2,9 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export ExperienceLibrary* PkmnLib_ExperienceLibrary_Construct() { return new ExperienceLibrary(); }
|
||||
export_func ExperienceLibrary* PkmnLib_ExperienceLibrary_Construct() { return new ExperienceLibrary(); }
|
||||
|
||||
export uint8_t PkmnLib_ExperienceLibrary_HandleExperienceGain(ExperienceLibrary* p,
|
||||
export_func uint8_t PkmnLib_ExperienceLibrary_HandleExperienceGain(ExperienceLibrary* p,
|
||||
CreatureLib::Battling::Creature* faintedMon,
|
||||
CreatureLib::Battling::Creature* const* opponents,
|
||||
size_t numberOfOpponents) {
|
||||
|
@ -12,4 +12,4 @@ export uint8_t PkmnLib_ExperienceLibrary_HandleExperienceGain(ExperienceLibrary*
|
|||
opponents, opponents + numberOfOpponents));)
|
||||
}
|
||||
|
||||
export void PkmnLib_ExperienceLibrary_Destruct(ExperienceLibrary* p) { delete p; }
|
||||
export_func void PkmnLib_ExperienceLibrary_Destruct(ExperienceLibrary* p) { delete p; }
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export MiscLibrary* PkmnLib_MiscLibrary_Construct(PkmnLib::Library::TimeOfDay (*getTime)()) {
|
||||
export_func MiscLibrary* PkmnLib_MiscLibrary_Construct(PkmnLib::Library::TimeOfDay (*getTime)()) {
|
||||
return new MiscLibrary(getTime);
|
||||
}
|
||||
|
||||
export void PkmnLib_MiscLibrary_Destruct(MiscLibrary* p) { delete p; }
|
||||
export_func void PkmnLib_MiscLibrary_Destruct(MiscLibrary* p) { delete p; }
|
||||
|
||||
export u8 PkmnLib_MiscLibrary_CanEvolveFromLevelUp(bool& out, MiscLibrary* p,
|
||||
export_func u8 PkmnLib_MiscLibrary_CanEvolveFromLevelUp(bool& out, MiscLibrary* p,
|
||||
const PkmnLib::Library::EvolutionData* evoData,
|
||||
const Pokemon* pokemon) {
|
||||
Try(out = p->CanEvolveFromLevelUp(evoData, pokemon))
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export uint8_t PkmnLib_PkmnScript_ModifyCriticalStage(PkmnScript* script,
|
||||
export_func uint8_t PkmnLib_PkmnScript_ModifyCriticalStage(PkmnScript* script,
|
||||
CreatureLib::Battling::ExecutingAttack* attack,
|
||||
CreatureLib::Battling::Creature* target, uint8_t hit,
|
||||
uint8_t* critStage) {
|
||||
Try(script->ModifyCriticalStage(attack, target, hit, critStage);)
|
||||
}
|
||||
|
||||
export u8 PkmnLib_EvolutionScript_DoesEvolveFromLevelUp(EvolutionScript* script,
|
||||
export_func u8 PkmnLib_EvolutionScript_DoesEvolveFromLevelUp(EvolutionScript* script,
|
||||
const PkmnLib::Library::EvolutionData* evoData,
|
||||
const Pokemon* pokemon, bool* out) {
|
||||
Try(script->DoesEvolveFromLevelUp(evoData, pokemon, out));
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export uint8_t
|
||||
export_func uint8_t
|
||||
PkmnLib_Pokemon_Construct(Pokemon*& out, const BattleLibrary* library, const PkmnLib::Library::PokemonSpecies* species,
|
||||
const PkmnLib::Library::PokemonForme* forme, uint8_t level, uint32_t experience, uint32_t uid,
|
||||
CreatureLib::Library::Gender gender, uint8_t coloring, const PkmnLib::Library::Item* heldItem,
|
||||
|
@ -27,37 +27,37 @@ PkmnLib_Pokemon_Construct(Pokemon*& out, const BattleLibrary* library, const Pkm
|
|||
})
|
||||
};
|
||||
|
||||
export void PkmnLib_Pokemon_Destruct(const Pokemon* p) { delete p; }
|
||||
export_func void PkmnLib_Pokemon_Destruct(const Pokemon* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(Pokemon, IsShiny, bool)
|
||||
SIMPLE_GET_FUNC(Pokemon, WasCaught, bool)
|
||||
SIMPLE_GET_FUNC_SMART_PTR(Pokemon, GetNature, const PkmnLib::Library::Nature*)
|
||||
|
||||
export u8 PkmnLib_Pokemon_GetIndividualValue(const Pokemon* p, CreatureLib::Library::Statistic stat) {
|
||||
export_func u8 PkmnLib_Pokemon_GetIndividualValue(const Pokemon* p, CreatureLib::Library::Statistic stat) {
|
||||
return p->GetIndividualValue(stat);
|
||||
}
|
||||
export void PkmnLib_Pokemon_SetIndividualValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) {
|
||||
export_func void PkmnLib_Pokemon_SetIndividualValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) {
|
||||
p->SetIndividualValue(stat, value);
|
||||
}
|
||||
|
||||
export u8 PkmnLib_Pokemon_GetEffortValue(const Pokemon* p, CreatureLib::Library::Statistic stat) {
|
||||
export_func u8 PkmnLib_Pokemon_GetEffortValue(const Pokemon* p, CreatureLib::Library::Statistic stat) {
|
||||
return p->GetEffortValue(stat);
|
||||
}
|
||||
export void PkmnLib_Pokemon_SetEffortValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) {
|
||||
export_func void PkmnLib_Pokemon_SetEffortValue(Pokemon* p, CreatureLib::Library::Statistic stat, uint8_t value) {
|
||||
p->SetEffortValue(stat, value);
|
||||
}
|
||||
|
||||
SIMPLE_GET_FUNC(Pokemon, GetFriendship, uint8_t)
|
||||
export void PkmnLib_Pokemon_SetFriendship(Pokemon* p, u8 value) { p->SetFriendship(value); }
|
||||
export void PkmnLib_Pokemon_ChangeFriendship(Pokemon* p, i8 amount) { p->ChangeFriendship(amount); }
|
||||
export_func void PkmnLib_Pokemon_SetFriendship(Pokemon* p, u8 value) { p->SetFriendship(value); }
|
||||
export_func void PkmnLib_Pokemon_ChangeFriendship(Pokemon* p, i8 amount) { p->ChangeFriendship(amount); }
|
||||
SIMPLE_GET_FUNC(Pokemon, IsEgg, bool)
|
||||
export void PkmnLib_Pokemon_SetIsEgg(Pokemon* p, bool value) { p->SetIsEgg(value); }
|
||||
export_func void PkmnLib_Pokemon_SetIsEgg(Pokemon* p, bool value) { p->SetIsEgg(value); }
|
||||
|
||||
export u8 PkmnLib_Pokemon_Evolve(Pokemon* p, const PkmnLib::Library::PokemonSpecies* species,
|
||||
export_func u8 PkmnLib_Pokemon_Evolve(Pokemon* p, const PkmnLib::Library::PokemonSpecies* species,
|
||||
const PkmnLib::Library::PokemonForme* forme) {
|
||||
Try(p->Evolve(species, forme);)
|
||||
}
|
||||
|
||||
export u8 PkmnLib_Pokemon_AttemptCapture(Pokemon* p, PkmnLib::Library::Item* non_null catchItem) {
|
||||
export_func u8 PkmnLib_Pokemon_AttemptCapture(Pokemon* p, PkmnLib::Library::Item* non_null catchItem) {
|
||||
Try(p->AttemptCapture(catchItem);)
|
||||
}
|
|
@ -2,6 +2,6 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Battling;
|
||||
|
||||
export StatCalculator* PkmnLib_StatCalculator_Construct() { return new StatCalculator(); }
|
||||
export_func StatCalculator* PkmnLib_StatCalculator_Construct() { return new StatCalculator(); }
|
||||
|
||||
export void PkmnLib_StatCalculator_Destruct(StatCalculator* p) { delete p; }
|
||||
export_func void PkmnLib_StatCalculator_Destruct(StatCalculator* p) { delete p; }
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
std::string ExceptionHandler::_pkmnLibLastException = "";
|
||||
std::string ExceptionHandler::_pkmnLibLastExceptionStacktrace = "Unset";
|
||||
|
||||
export const char* PkmnLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
||||
export const char* PkmnLib_C_GetLastExceptionStacktrace() { return ExceptionHandler::GetLastExceptionStacktrace(); }
|
||||
export_func const char* PkmnLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
|
||||
export_func const char* PkmnLib_C_GetLastExceptionStacktrace() { return ExceptionHandler::GetLastExceptionStacktrace(); }
|
|
@ -6,7 +6,7 @@
|
|||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#define export extern "C" [[maybe_unused]]
|
||||
#define export_func extern "C" [[maybe_unused]]
|
||||
|
||||
#define PkmnLibException 4
|
||||
|
||||
|
@ -46,10 +46,10 @@ public:
|
|||
}
|
||||
|
||||
#define SIMPLE_GET_FUNC(type, name, returnType) \
|
||||
export returnType PkmnLib_##type##_##name(const type* p) { return p->name(); }
|
||||
export_func returnType PkmnLib_##type##_##name(const type* p) { return p->name(); }
|
||||
#define SIMPLE_GET_FUNC_SMART_PTR(type, name, returnType) \
|
||||
export returnType PkmnLib_##type##_##name(const type* p) { return p->name().GetRaw(); }
|
||||
export_func returnType PkmnLib_##type##_##name(const type* p) { return p->name().GetRaw(); }
|
||||
#define DESTRUCTOR(type) \
|
||||
export void PkmnLib_##type##_Destruct(const type* p) { delete p; }
|
||||
export_func void PkmnLib_##type##_Destruct(const type* p) { delete p; }
|
||||
|
||||
#endif // PKMNLIB_CORE_HPP
|
||||
|
|
|
@ -2,78 +2,78 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateLevelEvolution(uint8_t level, const PokemonSpecies* into) {
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateLevelEvolution(uint8_t level, const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateLevelEvolution(level, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipEvolution(uint8_t friendship,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipEvolution(uint8_t friendship,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateFriendshipEvolution(friendship, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipTimeEvolution(uint8_t friendship, TimeOfDay startTime,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateFriendshipTimeEvolution(uint8_t friendship, TimeOfDay startTime,
|
||||
TimeOfDay endTime,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateFriendshipTimeEvolution(friendship, startTime, endTime, into);
|
||||
}
|
||||
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateKnownMoveEvolution(const MoveData* move,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateKnownMoveEvolution(const MoveData* move,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateKnownMoveEvolution(move, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateLocationEvolution(const char* location,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateLocationEvolution(const char* location,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateLocationEvolution(ArbUt::StringView(location), into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateTimeEvolution(TimeOfDay startTime, TimeOfDay endTime,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateTimeEvolution(TimeOfDay startTime, TimeOfDay endTime,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateTimeEvolution(startTime, endTime, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemEvolution(const Item* item,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemEvolution(const Item* item,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateHeldItemEvolution(item, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemTimeEvolution(const Item* item, TimeOfDay startTime,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateHeldItemTimeEvolution(const Item* item, TimeOfDay startTime,
|
||||
TimeOfDay endTime,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateHeldItemTimeEvolution(item, startTime, endTime, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateGenderBasedEvolution(CreatureLib::Library::Gender gender,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateGenderBasedEvolution(CreatureLib::Library::Gender gender,
|
||||
uint8_t level,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateGenderBasedEvolution(gender, level, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateItemUseEvolution(const Item* item, const PokemonSpecies* into) {
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateItemUseEvolution(const Item* item, const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateItemUseEvolution(item, into);
|
||||
}
|
||||
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateItemUseWithGenderEvolution(const Item* item,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateItemUseWithGenderEvolution(const Item* item,
|
||||
CreatureLib::Library::Gender gender,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateItemUseWithGenderEvolution(item, gender, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateTradeEvolution(const PokemonSpecies* into) {
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateTradeEvolution(const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateTradeEvolution(into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateTradeWithItemEvolution(const Item* item,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateTradeWithItemEvolution(const Item* item,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateTradeWithItemEvolution(item, into);
|
||||
}
|
||||
export const EvolutionData* PkmnLib_EvolutionData_CreateTradeWithSpeciesEvolution(const PokemonSpecies* traded,
|
||||
export_func const EvolutionData* PkmnLib_EvolutionData_CreateTradeWithSpeciesEvolution(const PokemonSpecies* traded,
|
||||
const PokemonSpecies* into) {
|
||||
return EvolutionData::CreateTradeWithSpeciesEvolution(traded, into);
|
||||
}
|
||||
export const EvolutionData*
|
||||
export_func const EvolutionData*
|
||||
PkmnLib_EvolutionData_CreateCustomEvolution(const CreatureLib::Library::EffectParameter** data, size_t dataLength,
|
||||
const PokemonSpecies* into) {
|
||||
auto list = std::vector<const CreatureLib::Library::EffectParameter*>(data, data + dataLength);
|
||||
return EvolutionData::CreateCustomEvolution(list, into);
|
||||
}
|
||||
|
||||
export EvolutionMethod PkmnLib_EvolutionData_GetMethod(const EvolutionData* data) { return data->GetMethod(); }
|
||||
export const PokemonSpecies* PkmnLib_EvolutionData_GetNewSpecies(const EvolutionData* data) {
|
||||
export_func EvolutionMethod PkmnLib_EvolutionData_GetMethod(const EvolutionData* data) { return data->GetMethod(); }
|
||||
export_func const PokemonSpecies* PkmnLib_EvolutionData_GetNewSpecies(const EvolutionData* data) {
|
||||
return data->GetNewSpecies().GetRaw();
|
||||
}
|
||||
export size_t PkmnLib_EvolutionData_GetDataCount(const EvolutionData* data) { return data->GetDataCount(); }
|
||||
export uint8_t PkmnLib_EvolutionData_GetDataAt(const EvolutionData* data, size_t index,
|
||||
export_func size_t PkmnLib_EvolutionData_GetDataCount(const EvolutionData* data) { return data->GetDataCount(); }
|
||||
export_func uint8_t PkmnLib_EvolutionData_GetDataAt(const EvolutionData* data, size_t index,
|
||||
const CreatureLib::Library::EffectParameter*& out) {
|
||||
Try(out = data->GetDataAt(index).GetRaw());
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export Item* PkmnLib_Item_Construct(const char* name, CreatureLib::Library::ItemCategory category,
|
||||
export_func Item* PkmnLib_Item_Construct(const char* name, CreatureLib::Library::ItemCategory category,
|
||||
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
|
||||
const char* effectName, CreatureLib::Library::EffectParameter* effectParameters[],
|
||||
size_t effectParameterCount, const char* battleTriggerEffectName,
|
||||
|
@ -28,6 +28,6 @@ export Item* PkmnLib_Item_Construct(const char* name, CreatureLib::Library::Item
|
|||
conversedFlags, flingPower);
|
||||
};
|
||||
|
||||
export void PkmnLib_Item_Destruct(const Item* p) { delete p; }
|
||||
export_func void PkmnLib_Item_Destruct(const Item* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(Item, GetFlingPower, uint8_t)
|
|
@ -2,13 +2,13 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export uint8_t PkmnLib_LearnableMoves_Construct(LearnableMoves*& out, size_t levelAttackCapacity) {
|
||||
export_func uint8_t PkmnLib_LearnableMoves_Construct(LearnableMoves*& out, size_t levelAttackCapacity) {
|
||||
Try(out = new LearnableMoves(levelAttackCapacity));
|
||||
}
|
||||
DESTRUCTOR(LearnableMoves)
|
||||
|
||||
export void PkmnLib_LearnableMoves_AddEggMove(LearnableMoves* p, MoveData* move) { p->AddEggMove(move); }
|
||||
export size_t PkmnLib_LearnableMoves_GetEggMovesCount(LearnableMoves* p) { return p->GetEggMoves().Count(); }
|
||||
export const MoveData* const* PkmnLib_LearnableMoves_GetEggMoves(LearnableMoves* p) {
|
||||
export_func void PkmnLib_LearnableMoves_AddEggMove(LearnableMoves* p, MoveData* move) { p->AddEggMove(move); }
|
||||
export_func size_t PkmnLib_LearnableMoves_GetEggMovesCount(LearnableMoves* p) { return p->GetEggMoves().Count(); }
|
||||
export_func const MoveData* const* PkmnLib_LearnableMoves_GetEggMoves(LearnableMoves* p) {
|
||||
return reinterpret_cast<const MoveData* const*>(p->GetEggMoves().RawData());
|
||||
}
|
|
@ -2,11 +2,11 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export const LibrarySettings* PkmnLib_LibrarySettings_Construct(uint8_t maximalLevel, uint8_t maximalMoves,
|
||||
export_func const LibrarySettings* PkmnLib_LibrarySettings_Construct(uint8_t maximalLevel, uint8_t maximalMoves,
|
||||
uint16_t shinyRate) {
|
||||
return new LibrarySettings(maximalLevel, maximalMoves, shinyRate);
|
||||
}
|
||||
|
||||
export void PkmnLib_LibrarySettings_Destruct(const LibrarySettings* p) { delete p; }
|
||||
export_func void PkmnLib_LibrarySettings_Destruct(const LibrarySettings* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(LibrarySettings, GetShinyRate, uint16_t);
|
|
@ -2,19 +2,19 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export Nature* PkmnLib_Nature_Construct(CreatureLib::Library::Statistic increasedStat,
|
||||
export_func Nature* PkmnLib_Nature_Construct(CreatureLib::Library::Statistic increasedStat,
|
||||
CreatureLib::Library::Statistic decreasedStat, float increasedModifier,
|
||||
float decreasedModifier) {
|
||||
return new Nature(increasedStat, decreasedStat, increasedModifier, decreasedModifier);
|
||||
}
|
||||
export void PkmnLib_Nature_Destruct(const Nature* p) { delete p; }
|
||||
export_func void PkmnLib_Nature_Destruct(const Nature* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(Nature, GetIncreaseModifier, float)
|
||||
SIMPLE_GET_FUNC(Nature, GetDecreaseModifier, float)
|
||||
SIMPLE_GET_FUNC(Nature, GetIncreasedStat, CreatureLib::Library::Statistic)
|
||||
SIMPLE_GET_FUNC(Nature, GetDecreasedStat, CreatureLib::Library::Statistic)
|
||||
|
||||
export float PkmnLib_Nature_GetStatModifier(const PkmnLib::Library::Nature* nature,
|
||||
export_func float PkmnLib_Nature_GetStatModifier(const PkmnLib::Library::Nature* nature,
|
||||
CreatureLib::Library::Statistic stat) {
|
||||
return nature->GetStatModifier(stat);
|
||||
}
|
|
@ -2,27 +2,27 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export NatureLibrary* PkmnLib_NatureLibrary_Construct(size_t initialCapacity) {
|
||||
export_func NatureLibrary* PkmnLib_NatureLibrary_Construct(size_t initialCapacity) {
|
||||
return new NatureLibrary(initialCapacity);
|
||||
}
|
||||
export void PkmnLib_NatureLibrary_Destruct(const NatureLibrary* p) { delete p; }
|
||||
export_func void PkmnLib_NatureLibrary_Destruct(const NatureLibrary* p) { delete p; }
|
||||
|
||||
export uint8_t PkmnLib_NatureLibrary_LoadNature(NatureLibrary* p, const char* name, const Nature* nature) {
|
||||
export_func uint8_t PkmnLib_NatureLibrary_LoadNature(NatureLibrary* p, const char* name, const Nature* nature) {
|
||||
Try(p->LoadNature(ArbUt::StringView(name), nature);)
|
||||
}
|
||||
export uint8_t PkmnLib_NatureLibrary_GetNatureByName(NatureLibrary* p, const char* name, const Nature*& out) {
|
||||
export_func uint8_t PkmnLib_NatureLibrary_GetNatureByName(NatureLibrary* p, const char* name, const Nature*& out) {
|
||||
Try(out = p->GetNatureByName(ArbUt::StringView(name)).GetRaw());
|
||||
}
|
||||
|
||||
export uint8_t PkmnLib_NatureLibrary_GetRandomNatureName(NatureLibrary* p, ArbUt::Random* rand, const char*& out) {
|
||||
export_func uint8_t PkmnLib_NatureLibrary_GetRandomNatureName(NatureLibrary* p, ArbUt::Random* rand, const char*& out) {
|
||||
Try(out = p->GetRandomNatureName(*rand).c_str();)
|
||||
}
|
||||
|
||||
export uint8_t PkmnLib_NatureLibrary_GetNatureName(NatureLibrary* p, const Nature* nature, const char*& out) {
|
||||
export_func uint8_t PkmnLib_NatureLibrary_GetNatureName(NatureLibrary* p, const Nature* nature, const char*& out) {
|
||||
Try(out = p->GetNatureName(nature).c_str());
|
||||
}
|
||||
|
||||
SIMPLE_GET_FUNC(NatureLibrary, GetNatureCount, size_t)
|
||||
export uint8_t PkmnLib_NatureLibrary_GetNatureByIndex(NatureLibrary* p, size_t index, const char*& out) {
|
||||
export_func uint8_t PkmnLib_NatureLibrary_GetNatureByIndex(NatureLibrary* p, size_t index, const char*& out) {
|
||||
Try(out = p->GetNatureFromIndex(index).c_str();)
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export PokemonForme*
|
||||
export_func PokemonForme*
|
||||
PkmnLib_PokemonForme_Construct(const char* name, float height, float weight, uint32_t baseExperience, uint8_t types[],
|
||||
size_t typeLength, uint16_t baseHealth, uint16_t baseAttack, uint16_t baseDefense,
|
||||
uint16_t baseMagicalAttack, uint16_t baseMagicalDefense, uint16_t baseSpeed,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export uint8_t PkmnLib_PokemonLibrary_Construct(PokemonLibrary*& out, PkmnLib::Library::LibrarySettings* settings,
|
||||
export_func uint8_t PkmnLib_PokemonLibrary_Construct(PokemonLibrary*& out, PkmnLib::Library::LibrarySettings* settings,
|
||||
SpeciesLibrary* species, MoveLibrary* moves, ItemLibrary* items,
|
||||
CreatureLib::Library::GrowthRateLibrary* growthRates,
|
||||
CreatureLib::Library::TypeLibrary* typeLibrary,
|
||||
|
@ -11,7 +11,7 @@ export uint8_t PkmnLib_PokemonLibrary_Construct(PokemonLibrary*& out, PkmnLib::L
|
|||
Try(out = new PokemonLibrary(settings, species, moves, items, growthRates, typeLibrary, talentLibrary, natures));
|
||||
}
|
||||
|
||||
export void PkmnLib_PokemonLibrary_Destruct(const PokemonLibrary* p) { delete p; }
|
||||
export const NatureLibrary* PkmnLib_PokemonLibrary_GetNatureLibrary(const PokemonLibrary* p) {
|
||||
export_func void PkmnLib_PokemonLibrary_Destruct(const PokemonLibrary* p) { delete p; }
|
||||
export_func const NatureLibrary* PkmnLib_PokemonLibrary_GetNatureLibrary(const PokemonLibrary* p) {
|
||||
return p->GetNatureLibrary().GetRaw();
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export uint8_t PkmnLib_PokemonSpecies_Construct(const PokemonSpecies*& out, uint16_t id, const char* name,
|
||||
export_func uint8_t PkmnLib_PokemonSpecies_Construct(const PokemonSpecies*& out, uint16_t id, const char* name,
|
||||
const PokemonForme* defaultForme, float genderRatio,
|
||||
const char* growthRate, uint8_t captureRate, uint8_t baseHappiness,
|
||||
const char* const* eggGroupsRaw, size_t eggGroupsLength,
|
||||
|
@ -20,22 +20,22 @@ export uint8_t PkmnLib_PokemonSpecies_Construct(const PokemonSpecies*& out, uint
|
|||
eggGroups, conversedFlags);)
|
||||
}
|
||||
|
||||
export void PkmnLib_PokemonSpecies_Destruct(const PokemonSpecies* p) { delete p; }
|
||||
export_func void PkmnLib_PokemonSpecies_Destruct(const PokemonSpecies* p) { delete p; }
|
||||
|
||||
SIMPLE_GET_FUNC(PokemonSpecies, GetBaseHappiness, uint8_t);
|
||||
export void PkmnLib_PokemonSpecies_AddEvolution(PokemonSpecies* p, EvolutionData* evo) { p->AddEvolution(evo); }
|
||||
export_func void PkmnLib_PokemonSpecies_AddEvolution(PokemonSpecies* p, EvolutionData* evo) { p->AddEvolution(evo); }
|
||||
|
||||
export size_t PkmnLib_PokemonSpecies_GetEvolutionCount(const PokemonSpecies* p) { return p->GetEvolutions().Count(); }
|
||||
export_func size_t PkmnLib_PokemonSpecies_GetEvolutionCount(const PokemonSpecies* p) { return p->GetEvolutions().Count(); }
|
||||
|
||||
export uint8_t PkmnLib_PokemonSpecies_GetEvolution(const PokemonSpecies* p, size_t index, const EvolutionData*& out) {
|
||||
export_func uint8_t PkmnLib_PokemonSpecies_GetEvolution(const PokemonSpecies* p, size_t index, const EvolutionData*& out) {
|
||||
Try(out = p->GetEvolutions().At(index).GetRaw());
|
||||
}
|
||||
|
||||
export uint8_t PkmnLib_PokemonSpecies_GetEvolutions(const PokemonSpecies* p, const EvolutionData* const*& out) {
|
||||
export_func uint8_t PkmnLib_PokemonSpecies_GetEvolutions(const PokemonSpecies* p, const EvolutionData* const*& out) {
|
||||
Try(out = p->GetEvolutions().RawData());
|
||||
}
|
||||
|
||||
export size_t PkmnLib_PokemonSpecies_GetEggGroupCount(const PokemonSpecies* p) { return p->GetEggGroups().Count(); }
|
||||
export const char* PkmnLib_PokemonSpecies_GetEggGroup(const PokemonSpecies* p, size_t index) {
|
||||
export_func size_t PkmnLib_PokemonSpecies_GetEggGroupCount(const PokemonSpecies* p) { return p->GetEggGroups().Count(); }
|
||||
export_func const char* PkmnLib_PokemonSpecies_GetEggGroup(const PokemonSpecies* p, size_t index) {
|
||||
return p->GetEggGroups()[index].c_str();
|
||||
}
|
|
@ -2,11 +2,11 @@
|
|||
#include "../Core.hpp"
|
||||
using namespace PkmnLib::Library;
|
||||
|
||||
export const SpeciesLibrary* PkmnLib_SpeciesLibrary_Construct(size_t initialCapacity) {
|
||||
export_func const SpeciesLibrary* PkmnLib_SpeciesLibrary_Construct(size_t initialCapacity) {
|
||||
return new SpeciesLibrary(initialCapacity);
|
||||
};
|
||||
|
||||
export u8 PkmnLib_SpeciesLibrary_FindPreEvolution(const PokemonSpecies*& out, const SpeciesLibrary* p,
|
||||
export_func u8 PkmnLib_SpeciesLibrary_FindPreEvolution(const PokemonSpecies*& out, const SpeciesLibrary* p,
|
||||
const PokemonSpecies* species) {
|
||||
Try(
|
||||
auto v = p->FindPreEvolution(species);
|
||||
|
|
|
@ -23,6 +23,12 @@ endif ()
|
|||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
add_link_options(-fuse-ld=lld)
|
||||
# Only warn for unknown sanitizers. This error is not major enough to error on.
|
||||
add_compile_options(-Wno-error=unknown-sanitizers)
|
||||
# Ignore pedantic nullability extension warning, as we only use this for clang specifically
|
||||
add_compile_options(-Wno-nullability-extension)
|
||||
# As far as I can tell this is an invalid pedantic warning since C++ 20. Empty variadic macro arguments is completely legal.
|
||||
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
|
||||
endif ()
|
||||
|
||||
execute_process(COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/include)
|
||||
|
@ -159,7 +165,7 @@ endif ()
|
|||
file(GLOB_RECURSE CORE_SRC_FILES ${FILE_SOURCE})
|
||||
add_library(pkmnLib ${LIBTYPE} ${CORE_SRC_FILES})
|
||||
# Enable all warnings, and make them error when occurring.
|
||||
target_compile_options(pkmnLib PRIVATE -Wall -Wextra -Werror)
|
||||
target_compile_options(pkmnLib PRIVATE -Wall -Wextra -Werror -pedantic-errors)
|
||||
target_link_directories(pkmnLib PUBLIC ${Angelscript_BINARY_DIR})
|
||||
|
||||
# If interprocedural optimization is available, apply it
|
||||
|
@ -218,7 +224,7 @@ if (PKMNLIB_TESTS)
|
|||
file(GLOB_RECURSE TEST_FILES "tests/*.cpp" "tests/*.hpp")
|
||||
add_executable(pkmnLibTests ${TEST_FILES})
|
||||
# Enable all warnings, and make them error when occurring.
|
||||
target_compile_options(pkmnLibTests PRIVATE -Wall -Wextra -Werror)
|
||||
target_compile_options(pkmnLibTests PRIVATE -Wall -Wextra -Werror -pedantic-errors)
|
||||
|
||||
message(STATUS "${_TESTLINKS}")
|
||||
target_link_libraries(pkmnLibTests PUBLIC ${_TESTLINKS})
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace PkmnLib::Battling {
|
|||
"struggle"_cnc, 0, PkmnLib::Library::MoveCategory::Physical, 50, 255, 10,
|
||||
CreatureLib::Library::AttackTarget::Any, 0,
|
||||
new CreatureLib::Library::SecondaryEffect(-1, "struggle"_cnc, {}), std::unordered_set<uint32_t>());
|
||||
;
|
||||
|
||||
std::unique_ptr<CreatureLib::Battling::LearnedAttack> _struggle =
|
||||
std::make_unique<PkmnLib::Battling::LearnedMove>(_struggleData,
|
||||
CreatureLib::Battling::AttackLearnMethod::Unknown);
|
||||
|
|
|
@ -15,7 +15,7 @@ class AngelScriptEvolutionScript final : public PkmnLib::Battling::EvolutionScri
|
|||
asIScriptFunction* nullable Function = nullptr;
|
||||
};
|
||||
|
||||
#define EVO_SCRIPT_HOOK_FUNCTION(name, decl) FunctionInfo __##name = Initialize(decl);
|
||||
#define EVO_SCRIPT_HOOK_FUNCTION(name, decl) FunctionInfo __##name = Initialize(decl)
|
||||
|
||||
FunctionInfo Initialize(const std::string& decl) {
|
||||
auto val = _scriptObject->GetObjectType()->GetMethodByDecl(decl.c_str(), false);
|
||||
|
|
|
@ -70,7 +70,7 @@ private:
|
|||
FunctionInfo __GetOwner = InitializeGetOwner();
|
||||
FunctionInfo __SetOwner = InitializeSetOwner();
|
||||
|
||||
#define ITEM_USE_SCRIPT_HOOK_FUNCTION(name, decl) FunctionInfo __##name = Initialize(decl);
|
||||
#define ITEM_USE_SCRIPT_HOOK_FUNCTION(name, decl) FunctionInfo __##name = Initialize(decl)
|
||||
|
||||
ITEM_USE_SCRIPT_HOOK_FUNCTION(
|
||||
OnInitialize, "void OnInitialize(const BattleLibrary@ library, const narray<EffectParameter@>@ parameters)");
|
||||
|
|
|
@ -17,7 +17,7 @@ static std::string ImplConstStringStringConv(const ArbUt::StringView& s) { retur
|
|||
|
||||
void ConstStringRegister::Register(asIScriptEngine* engine) {
|
||||
auto r = engine->RegisterObjectType("constString", sizeof(ArbUt::StringView),
|
||||
asOBJ_VALUE | asGetTypeTraits<ArbUt::StringView>());
|
||||
asOBJ_VALUE | asGetTypeTraits<ArbUt::StringView>() | asOBJ_APP_CLASS_ALIGN8);
|
||||
Ensure(r >= 0);
|
||||
|
||||
r = engine->RegisterObjectBehaviour("constString", asBEHAVE_CONSTRUCT, "void f()", asFUNCTION(ConstructConstString),
|
||||
|
|
Loading…
Reference in New Issue