17 lines
524 B
C++
17 lines
524 B
C++
|
|
#include "UserDataFunction.hpp"
|
|
|
|
using namespace Porygon::Evaluation;
|
|
|
|
namespace Porygon::UserData{
|
|
extern "C" {
|
|
const EvalValue * CreateFunctionEvalValue(const Evaluation::EvalValue* (*func)(void*, const ScriptOptions*,
|
|
const EvalValue* [], int ), void* obj) {
|
|
auto opt = new UserDataFunction(func, obj);
|
|
auto t = new GenericFunctionEvalValue(make_shared<GenericFunctionScriptType>(), rand());
|
|
t->RegisterOption(opt);
|
|
return t;
|
|
}
|
|
}
|
|
}
|