Implements support for functions with the same name, but different parameters
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-29 19:59:42 +02:00
parent 24c560b52d
commit db2d731b06
23 changed files with 362 additions and 204 deletions

View File

@@ -67,14 +67,18 @@
#define PORYGON_FUNCTION(fieldName, returnType, ...) \
{ \
Porygon::Utilities::HashedString::ConstHash(#fieldName), \
new Porygon::UserData::UserDataField(Porygon::UserData::UserDataFunctionType::FromRawPointers(returnType, {__VA_ARGS__} ), \
new Porygon::UserData::UserDataField( \
new Porygon::GenericFunctionScriptType( \
Porygon::UserData::UserDataFunctionOption::FromRawPointers(returnType, {__VA_ARGS__} )), \
\
\
[](void* obj) -> Porygon::Evaluation::EvalValue* { \
return new Porygon::UserData::UserDataFunction( \
auto t = new Porygon::Evaluation::GenericFunctionEvalValue(make_shared<GenericFunctionScriptType>(), rand()); \
t->RegisterOption(new Porygon::UserData::UserDataFunction( \
[](void* obj, Porygon::Evaluation::EvalValue* par[], int parameterCount) \
-> Porygon::Evaluation::EvalValue*{return ((T_USERDATA*)obj)->invoke__##fieldName(obj, par, parameterCount);}, \
obj);}, \
obj)); \
return t;}, \
nullptr) \
},