Implements initial math library, several reworks for Userdata memory management
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-08-17 14:42:48 +02:00
parent 13b382def2
commit 5e96250d96
11 changed files with 167 additions and 46 deletions

View File

@@ -65,6 +65,13 @@ namespace Porygon {
this -> RegisterFunctionOption(option);
};
explicit GenericFunctionScriptType(const vector<GenericFunctionOption*>& options)
: ScriptType(Porygon::TypeClass::Function){
for (auto option: options){
this -> RegisterFunctionOption(option);
}
};
~GenericFunctionScriptType() final{
for (auto o: *_options){
delete o;
@@ -72,9 +79,10 @@ namespace Porygon {
delete _options;
}
void RegisterFunctionOption (GenericFunctionOption * opt) const{
const GenericFunctionScriptType* RegisterFunctionOption (GenericFunctionOption * opt) const{
opt->SetOption(_options->size());
_options->push_back(opt);
return this;
}
GenericFunctionOption* GetFunctionOption(const vector<shared_ptr<const ScriptType>>& parameters) const{