Implements support for functions with the same name, but different parameters
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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) \
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user