Adds a lot more WASM type registry
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-05-22 13:00:53 +02:00
parent 9adbd27358
commit a4ac678154
13 changed files with 111 additions and 15 deletions

View File

@@ -0,0 +1,13 @@
#include "WASMAbilityRegistry.hpp"
#include "../WASMHelperFile.hpp"
#include "wasm.h"
using namespace CreatureLib::Library;
using namespace PkmnLib::Library;
void WASMAbilityRegistry::Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs,
WebAssemblyScriptResolver* resolver) {
REGISTER_GETTER("ability_get_name", Talent, GetName, resolver);
REGISTER_GETTER("ability_get_effect", Talent, GetEffect, resolver);
REGISTER_GETTER("ability_get_parameters", Talent, GetParameters, resolver);
}

View File

@@ -0,0 +1,10 @@
#ifndef PKMNLIB_WASMABILITYREGISTRY_HPP
#define PKMNLIB_WASMABILITYREGISTRY_HPP
#include "../../WebAssemblyScriptResolver.hpp"
class WASMAbilityRegistry {
public:
static void Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs, WebAssemblyScriptResolver* resolver);
};
#endif // PKMNLIB_WASMABILITYREGISTRY_HPP

View File

@@ -0,0 +1,16 @@
#include "WASMEffectParameter.hpp"
#include "../../../../Battling/Library/BattleLibrary.hpp"
#include "../../WebAssemblyScriptResolver.hpp"
#include "../WASMHelperFile.hpp"
#include "wasm.h"
using namespace CreatureLib::Library;
void WASMEffectParameter::Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs,
WebAssemblyScriptResolver* resolver) {
REGISTER_GETTER("effect_parameter_get_type", EffectParameter, GetType, resolver)
REGISTER_GETTER("effect_parameter_as_bool", EffectParameter, AsBool, resolver)
REGISTER_GETTER("effect_parameter_as_int", EffectParameter, AsInt, resolver)
REGISTER_GETTER("effect_parameter_as_float", EffectParameter, AsFloat, resolver)
REGISTER_GETTER("effect_parameter_as_string", EffectParameter, AsString, resolver)
}

View File

@@ -0,0 +1,10 @@
#ifndef PKMNLIB_WASMEFFECTPARAMETER_HPP
#define PKMNLIB_WASMEFFECTPARAMETER_HPP
#include "../../WebAssemblyScriptResolver.hpp"
class WASMEffectParameter {
public:
static void Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs, WebAssemblyScriptResolver* resolver);
};
#endif // PKMNLIB_WASMEFFECTPARAMETER_HPP

View File

@@ -7,8 +7,7 @@ class WebAssemblyScriptResolver;
class WASMFormeRegistry {
public:
static void Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs,
WebAssemblyScriptResolver* resolver);
static void Register(ArbUt::Dictionary<std::string, wasm_func_t*>& externs, WebAssemblyScriptResolver* resolver);
};
#endif // PKMNLIB_WASMFORMEREGISTRY_HPP