Move script name to type.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-23 16:02:27 +01:00
parent 13a8228a44
commit 98e17a1eb8
7 changed files with 28 additions and 22 deletions

View File

@@ -16,11 +16,13 @@ private:
asIScriptObject* _obj = nullptr;
public:
AngelScriptScript(const std::string& name, AngelScriptTypeInfo* type, asIScriptObject* obj, ContextPool* ctxPool)
: PkmnLib::Battling::PkmnScript(name), _type(type), _ctxPool(ctxPool), _obj(obj) {}
AngelScriptScript(AngelScriptTypeInfo* type, asIScriptObject* obj, ContextPool* ctxPool)
: _type(type), _ctxPool(ctxPool), _obj(obj) {}
~AngelScriptScript() override { _obj->Release(); }
[[nodiscard]] const std::string& GetName() const override { return _type->GetName(); }
asIScriptFunction* PrepareMethod(const char* name, asIScriptContext* ctx) {
auto func = _type->GetFunction(name);
ctx->Prepare(func);