从master分支拉取puerts,并拉取v8制品,修改puerts插件部分UE5_5以下兼容的宏代码。保证puerts编译通过。包括
CSharpParamDefaultValueMetas.cs和ubtplugin.csproj和declarationGenerator.cpp和PropertyTranslator.cpp对UserDefinedStruct.h的引用
This commit is contained in:
@@ -170,6 +170,12 @@ public class JsEnv : ModuleRules
|
||||
string coreJSPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "Content"));
|
||||
string destDirName = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "..", "..", "Content"));
|
||||
DirectoryCopy(coreJSPath, destDirName, true);
|
||||
|
||||
// 每次build时拷贝一些手写的.d.ts到Typing目录以同步更新
|
||||
string srcDtsDirName = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "Typing"));
|
||||
string dstDtsDirName = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "..", "..", "Typing"));
|
||||
DirectoryCopy(srcDtsDirName, dstDtsDirName, true);
|
||||
|
||||
}
|
||||
|
||||
void OldThirdParty(ReadOnlyTargetRules Target)
|
||||
@@ -618,10 +624,14 @@ public class JsEnv : ModuleRules
|
||||
PublicDefinitions.Add("WITH_QJS_NAMESPACE_SUFFIX=1");
|
||||
PublicDefinitions.Add("QJSV8NAMESPACE=v8_qjs");
|
||||
}
|
||||
|
||||
string ThirdPartyPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty"));
|
||||
string HeaderPath = Path.GetFullPath(Path.Combine(ThirdPartyPath, "Include"));
|
||||
PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "websocketpp") });
|
||||
PublicIncludePaths.AddRange(new string[] { Path.Combine(HeaderPath, "asio") });
|
||||
PublicIncludePaths.AddRange(new string[] { Path.Combine(ThirdPartyPath, "quickjs", "Inc") });
|
||||
|
||||
PublicIncludePaths.AddRange(new string[] { Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "quickjs", "Inc") });
|
||||
|
||||
string LibraryPath = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "quickjs", "Lib"));
|
||||
string LibraryPath = Path.GetFullPath(Path.Combine(ThirdPartyPath, "quickjs", "Lib"));
|
||||
if (Target.Platform == UnrealTargetPlatform.Win64)
|
||||
{
|
||||
string V8LibraryPath = Path.Combine(LibraryPath, "Win64MD");
|
||||
|
||||
@@ -228,7 +228,12 @@ PropertyMacro* FContainerMeta::GetObjectProperty(UField* Field)
|
||||
if (Enum->GetCppForm() == UEnum::ECppForm::EnumClass)
|
||||
{
|
||||
FEnumProperty* EnumProp =
|
||||
#if ENGINE_MAJOR_VERSION > 4 && ENGINE_MINOR_VERSION > 4 // 5.5+
|
||||
new FEnumProperty(PropertyMetaRoot, NAME_None, RF_Transient);
|
||||
EnumProp->SetEnum(Enum);
|
||||
#else
|
||||
new FEnumProperty(PropertyMetaRoot, NAME_None, RF_Transient, 0, CPF_HasGetValueTypeHash, Enum);
|
||||
#endif
|
||||
FNumericProperty* UnderlyingProp = new FByteProperty(EnumProp, TEXT("UnderlyingType"), RF_Transient);
|
||||
EnumProp->AddCppProperty(UnderlyingProp);
|
||||
EnumProp->ElementSize = UnderlyingProp->ElementSize;
|
||||
|
||||
@@ -11,11 +11,6 @@
|
||||
|
||||
namespace PUERTS_NAMESPACE
|
||||
{
|
||||
template <typename T>
|
||||
inline void __USE(T&&)
|
||||
{
|
||||
}
|
||||
|
||||
static void ThrowException(v8::Isolate* Isolate, const char* Message)
|
||||
{
|
||||
auto ExceptionStr = v8::String::NewFromUtf8(Isolate, Message, v8::NewStringType::kNormal).ToLocalChecked();
|
||||
|
||||
@@ -81,7 +81,12 @@ static void FText_Format(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
}
|
||||
#endif
|
||||
|
||||
struct AutoRegisterForUE
|
||||
#if ENGINE_MAJOR_VERSION > 4
|
||||
UsingUClass(AActor);
|
||||
UsingUStruct(FHitResult)
|
||||
#endif
|
||||
|
||||
struct AutoRegisterForUE
|
||||
{
|
||||
AutoRegisterForUE()
|
||||
{
|
||||
@@ -130,6 +135,10 @@ struct AutoRegisterForUE
|
||||
.Function("Format", FText_Format, &FormatSignature)
|
||||
.Register();
|
||||
#endif
|
||||
|
||||
#if ENGINE_MAJOR_VERSION > 4
|
||||
PUERTS_NAMESPACE::DefineClass<FHitResult>().Method("GetActor", MakeFunction(&FHitResult::GetActor)).Register();
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,746 +8,44 @@
|
||||
|
||||
// gen by puerts gen tools
|
||||
|
||||
#include "GenHeaders.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DataTransfer.h"
|
||||
#include "JSClassRegister.h"
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/Box2D.h', line 111,
|
||||
// column 22> unsupported method : operator+= FBox2D &(const FVector2D &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/Box2D.h', line 130,
|
||||
// column 22> unsupported method : operator+= FBox2D &(const FBox2D &) __attribute__((thiscall))
|
||||
|
||||
static void* _FBox2DNew_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
FBox2D* Obj = new FBox2D();
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FBox2DNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
EForceInit Arg0 = EForceInit(Info[0]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
FBox2D* Obj = new FBox2D(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FBox2DNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[1]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
const FVector2D* Arg1 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[1]->ToObject(Context).ToLocalChecked());
|
||||
FBox2D* Obj = new FBox2D(*Arg0, *Arg1);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FBox2DNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsNumber())
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
const int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FBox2D* Obj = new FBox2D(Arg0, Arg1);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FBox2DNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void _FBox2DDelete_(void* Ptr, void* ClassData, void* EnvData)
|
||||
{
|
||||
FBox2D* Self = static_cast<FBox2D*>(Ptr);
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FBox2DDelete_:%p"), Self);
|
||||
delete Self;
|
||||
}
|
||||
static void FBox2DM_op_Equality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FBox2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FBox2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_op_Equality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator==(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_op_Inequality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FBox2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FBox2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_op_Inequality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator!=(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_op_Addition(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_op_Addition] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator+(*Arg0);
|
||||
void* Ptr = new FBox2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FBox2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FBox2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FBox2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_op_Addition] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator+(*Arg0);
|
||||
void* Ptr = new FBox2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FBox2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_set_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_set_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->operator[](Arg0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_ComputeSquaredDistanceToPoint(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_ComputeSquaredDistanceToPoint] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ComputeSquaredDistanceToPoint(*Arg0);
|
||||
auto V8Result = v8::Number::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_ExpandBy(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
const float Arg0 = Info[0]->ToNumber(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_ExpandBy] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ExpandBy(Arg0);
|
||||
void* Ptr = new FBox2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FBox2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetArea(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetArea] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetArea();
|
||||
auto V8Result = v8::Number::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetCenter(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetCenter] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetCenter();
|
||||
void* Ptr = new FVector2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetCenterAndExtents(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() && PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[0])->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(
|
||||
Isolate, PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[0])->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsObject() && PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(
|
||||
Isolate, PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
FVector2D* Arg0 = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(
|
||||
PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[0])->ToObject(Context).ToLocalChecked());
|
||||
FVector2D* Arg1 = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(
|
||||
PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetCenterAndExtents] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->GetCenterAndExtents(*Arg0, *Arg1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetClosestPointTo(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetClosestPointTo] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetClosestPointTo(*Arg0);
|
||||
void* Ptr = new FVector2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetExtent(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetExtent] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetExtent();
|
||||
void* Ptr = new FVector2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_GetSize(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_GetSize] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetSize();
|
||||
void* Ptr = new FVector2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_Init(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::M_Init] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->Init();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_Intersect(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FBox2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FBox2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_Intersect] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->Intersect(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_IsInside(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_IsInside] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->IsInside(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FBox2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FBox2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_IsInside] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->IsInside(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_ShiftBy(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector2D>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FVector2D* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_ShiftBy] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ShiftBy(*Arg0);
|
||||
void* Ptr = new FBox2D(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FBox2D>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FBox2DM_ToString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FBox2D::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void _FBox2DMinGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::Min] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, &(Self->Min), true);
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FBox2D, FVector2D>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FBox2DMinSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::Min] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->Min = *PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Value->ToObject(Context).ToLocalChecked());
|
||||
}
|
||||
static void _FBox2DMaxGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::Max] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FVector2D>(Isolate, Context, &(Self->Max), true);
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FBox2D, FVector2D>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FBox2DMaxSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::Max] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->Max = *PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector2D>(Value->ToObject(Context).ToLocalChecked());
|
||||
}
|
||||
static void _FBox2DbIsValidGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::bIsValid] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Boolean::New(Isolate, Self->bIsValid);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FBox2D, bool>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FBox2DbIsValidSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FBox2D>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FBox2D::bIsValid] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->bIsValid = Value->ToBoolean(Isolate)->Value();
|
||||
}
|
||||
#include "UsingTypeDecl.hpp"
|
||||
|
||||
struct AutoRegisterForFBox2D
|
||||
{
|
||||
AutoRegisterForFBox2D()
|
||||
{
|
||||
PUERTS_NAMESPACE::JSClassDefinition Def = JSClassEmptyDefinition;
|
||||
|
||||
static PUERTS_NAMESPACE::JSPropertyInfo Properties[] = {{"Min", _FBox2DMinGet_, _FBox2DMinSet_},
|
||||
{"Max", _FBox2DMaxGet_, _FBox2DMaxSet_}, {"bIsValid", _FBox2DbIsValidGet_, _FBox2DbIsValidSet_}, {0, 0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Methods[] = {{"op_Equality", FBox2DM_op_Equality},
|
||||
{"op_Inequality", FBox2DM_op_Inequality}, {"op_Addition", FBox2DM_op_Addition}, {"set_Item", FBox2DM_set_Item},
|
||||
{"ComputeSquaredDistanceToPoint", FBox2DM_ComputeSquaredDistanceToPoint}, {"ExpandBy", FBox2DM_ExpandBy},
|
||||
{"GetArea", FBox2DM_GetArea}, {"GetCenter", FBox2DM_GetCenter}, {"GetCenterAndExtents", FBox2DM_GetCenterAndExtents},
|
||||
{"GetClosestPointTo", FBox2DM_GetClosestPointTo}, {"GetExtent", FBox2DM_GetExtent}, {"GetSize", FBox2DM_GetSize},
|
||||
{"Init", FBox2DM_Init}, {"Intersect", FBox2DM_Intersect}, {"IsInside", FBox2DM_IsInside}, {"ShiftBy", FBox2DM_ShiftBy},
|
||||
{"ToString", FBox2DM_ToString}, {0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Functions[] = {{0, 0}};
|
||||
|
||||
Def.UETypeName = "Box2D";
|
||||
|
||||
Def.SetInitialize(_FBox2DNew_);
|
||||
Def.Finalize = _FBox2DDelete_;
|
||||
Def.Properties = Properties;
|
||||
Def.Methods = Methods;
|
||||
Def.Functions = Functions;
|
||||
|
||||
PUERTS_NAMESPACE::RegisterJSClass(Def);
|
||||
puerts::DefineClass<FBox2D>()
|
||||
.Constructor(CombineConstructors(MakeConstructor(FBox2D), MakeConstructor(FBox2D, EForceInit),
|
||||
MakeConstructor(FBox2D, const FVector2D&, const FVector2D&), MakeConstructor(FBox2D, const FVector2D*, const int32),
|
||||
MakeConstructor(FBox2D, const TArray<FVector2D>&)))
|
||||
.Property("Min", MakeProperty(&FBox2D::Min))
|
||||
.Property("Max", MakeProperty(&FBox2D::Max))
|
||||
.Property("bIsValid", MakeProperty(&FBox2D::bIsValid))
|
||||
.Method("op_Equality", MakeFunction(&FBox2D::operator==))
|
||||
.Method("op_Inequality", MakeFunction(&FBox2D::operator!=))
|
||||
.Method("op_Addition", CombineOverloads(MakeOverload(FBox2D(FBox2D::*)(const FVector2D&) const, &FBox2D::operator+),
|
||||
MakeOverload(FBox2D(FBox2D::*)(const FBox2D&) const, &FBox2D::operator+)))
|
||||
.Method("set_Item", SelectFunction(FVector2D & (FBox2D::*) (int32), &FBox2D::operator[]))
|
||||
.Method("ComputeSquaredDistanceToPoint", MakeFunction(&FBox2D::ComputeSquaredDistanceToPoint))
|
||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
|
||||
.Method("ExpandBy", SelectFunction(FBox2D(FBox2D::*)(const double W) const, &FBox2D::ExpandBy))
|
||||
#else
|
||||
.Method("ExpandBy", SelectFunction(FBox2D(FBox2D::*)(const float W) const, &FBox2D::ExpandBy))
|
||||
#endif
|
||||
.Method("GetArea", MakeFunction(&FBox2D::GetArea))
|
||||
.Method("GetCenter", MakeFunction(&FBox2D::GetCenter))
|
||||
.Method("GetCenterAndExtents", MakeFunction(&FBox2D::GetCenterAndExtents))
|
||||
.Method("GetClosestPointTo", MakeFunction(&FBox2D::GetClosestPointTo))
|
||||
.Method("GetExtent", MakeFunction(&FBox2D::GetExtent))
|
||||
.Method("GetSize", MakeFunction(&FBox2D::GetSize))
|
||||
.Method("Init", MakeFunction(&FBox2D::Init))
|
||||
.Method("Intersect", MakeFunction(&FBox2D::Intersect))
|
||||
.Method("IsInside", CombineOverloads(MakeOverload(bool (FBox2D::*)(const FVector2D&) const, &FBox2D::IsInside),
|
||||
MakeOverload(bool (FBox2D::*)(const FBox2D&) const, &FBox2D::IsInside)))
|
||||
.Method("ShiftBy", MakeFunction(&FBox2D::ShiftBy))
|
||||
.Method("ToString", MakeFunction(&FBox2D::ToString))
|
||||
.Register();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,552 +8,49 @@
|
||||
|
||||
// gen by puerts gen tools
|
||||
|
||||
#include "GenHeaders.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DataTransfer.h"
|
||||
#include "JSClassRegister.h"
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/Color.h', line 483,
|
||||
// column 19> unsupported method : operator+= void (const FColor &) __attribute__((thiscall))
|
||||
|
||||
static void* _FColorNew_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
FColor* Obj = new FColor();
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FColorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
EForceInit Arg0 = EForceInit(Info[0]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
FColor* Obj = new FColor(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FColorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 4)
|
||||
{
|
||||
if (Info[0]->IsNumber() && Info[1]->IsNumber() && Info[2]->IsNumber() && Info[3]->IsNumber())
|
||||
{
|
||||
uint8 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint8 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint8 Arg2 = Info[2]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint8 Arg3 = Info[3]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FColor* Obj = new FColor(Arg0, Arg1, Arg2, Arg3);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FColorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
uint32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FColor* Obj = new FColor(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FColorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void _FColorDelete_(void* Ptr, void* ClassData, void* EnvData)
|
||||
{
|
||||
FColor* Self = static_cast<FColor*>(Ptr);
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FColorDelete_:%p"), Self);
|
||||
delete Self;
|
||||
}
|
||||
static void FColorM_DWColor(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_DWColor] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->DWColor();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_DWColor] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->DWColor();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_op_Equality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FColor>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FColor* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_op_Equality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator==(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_op_Inequality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FColor>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FColor* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_op_Inequality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator!=(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_FromRGBE(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_FromRGBE] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->FromRGBE();
|
||||
void* Ptr = new FLinearColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FLinearColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorS_FromHex(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsString())
|
||||
{
|
||||
const FString Arg0 = UTF8_TO_TCHAR(*(v8::String::Utf8Value(Isolate, Info[0])));
|
||||
auto MethodResult = FColor::FromHex(Arg0);
|
||||
void* Ptr = new FColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorS_MakeRandomColor(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto MethodResult = FColor::MakeRandomColor();
|
||||
void* Ptr = new FColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorS_MakeRedToGreenColorFromScalar(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
float Arg0 = Info[0]->ToNumber(Context).ToLocalChecked()->Value();
|
||||
auto MethodResult = FColor::MakeRedToGreenColorFromScalar(Arg0);
|
||||
void* Ptr = new FColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorS_MakeFromColorTemperature(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
float Arg0 = Info[0]->ToNumber(Context).ToLocalChecked()->Value();
|
||||
auto MethodResult = FColor::MakeFromColorTemperature(Arg0);
|
||||
void* Ptr = new FColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_WithAlpha(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
uint8 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_WithAlpha] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->WithAlpha(Arg0);
|
||||
void* Ptr = new FColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ReinterpretAsLinear(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ReinterpretAsLinear] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ReinterpretAsLinear();
|
||||
void* Ptr = new FLinearColor(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FLinearColor>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToHex(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FColor::M_ToHex] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToHex();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_InitFromString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsString())
|
||||
{
|
||||
const FString Arg0 = UTF8_TO_TCHAR(*(v8::String::Utf8Value(Isolate, Info[0])));
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_InitFromString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->InitFromString(Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToPackedARGB(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ToPackedARGB] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToPackedARGB();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToPackedABGR(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ToPackedABGR] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToPackedABGR();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToPackedRGBA(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ToPackedRGBA] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToPackedRGBA();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FColorM_ToPackedBGRA(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FColor>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FColor::M_ToPackedBGRA] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToPackedBGRA();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
#include "UsingTypeDecl.hpp"
|
||||
|
||||
struct AutoRegisterForFColor
|
||||
{
|
||||
AutoRegisterForFColor()
|
||||
{
|
||||
PUERTS_NAMESPACE::JSClassDefinition Def = JSClassEmptyDefinition;
|
||||
|
||||
static PUERTS_NAMESPACE::JSPropertyInfo Properties[] = {{0, 0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Methods[] = {{"DWColor", FColorM_DWColor}, {"op_Equality", FColorM_op_Equality},
|
||||
{"op_Inequality", FColorM_op_Inequality}, {"FromRGBE", FColorM_FromRGBE}, {"WithAlpha", FColorM_WithAlpha},
|
||||
{"ReinterpretAsLinear", FColorM_ReinterpretAsLinear}, {"ToHex", FColorM_ToHex}, {"ToString", FColorM_ToString},
|
||||
{"InitFromString", FColorM_InitFromString}, {"ToPackedARGB", FColorM_ToPackedARGB},
|
||||
{"ToPackedABGR", FColorM_ToPackedABGR}, {"ToPackedRGBA", FColorM_ToPackedRGBA}, {"ToPackedBGRA", FColorM_ToPackedBGRA},
|
||||
{0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Functions[] = {{"FromHex", FColorS_FromHex},
|
||||
{"MakeRandomColor", FColorS_MakeRandomColor}, {"MakeRedToGreenColorFromScalar", FColorS_MakeRedToGreenColorFromScalar},
|
||||
{"MakeFromColorTemperature", FColorS_MakeFromColorTemperature}, {0, 0}};
|
||||
|
||||
Def.UETypeName = "Color";
|
||||
|
||||
Def.SetInitialize(_FColorNew_);
|
||||
Def.Finalize = _FColorDelete_;
|
||||
Def.Properties = Properties;
|
||||
Def.Methods = Methods;
|
||||
Def.Functions = Functions;
|
||||
|
||||
PUERTS_NAMESPACE::RegisterJSClass(Def);
|
||||
puerts::DefineClass<FColor>()
|
||||
.Constructor(CombineConstructors(MakeConstructor(FColor), MakeConstructor(FColor, EForceInit),
|
||||
MakeConstructor(FColor, uint8, uint8, uint8, uint8), MakeConstructor(FColor, uint32)))
|
||||
.Method("DWColor", CombineOverloads(MakeOverload(uint32 & (FColor::*) (), &FColor::DWColor),
|
||||
MakeOverload(const uint32& (FColor::*) () const, &FColor::DWColor)))
|
||||
.Method("op_Equality", MakeFunction(&FColor::operator==))
|
||||
.Method("op_Inequality", MakeFunction(&FColor::operator!=))
|
||||
.Method("FromRGBE", MakeFunction(&FColor::FromRGBE))
|
||||
.Function("FromHex", MakeFunction(&FColor::FromHex))
|
||||
.Function("MakeRandomColor", MakeFunction(&FColor::MakeRandomColor))
|
||||
.Function("MakeRedToGreenColorFromScalar", MakeFunction(&FColor::MakeRedToGreenColorFromScalar))
|
||||
.Function("MakeFromColorTemperature", MakeFunction(&FColor::MakeFromColorTemperature))
|
||||
.Method("WithAlpha", MakeFunction(&FColor::WithAlpha))
|
||||
.Method("ReinterpretAsLinear", MakeFunction(&FColor::ReinterpretAsLinear))
|
||||
.Method("ToHex", MakeFunction(&FColor::ToHex))
|
||||
.Method("ToString", MakeFunction(&FColor::ToString))
|
||||
.Method("InitFromString", MakeFunction(&FColor::InitFromString))
|
||||
.Method("ToPackedARGB", MakeFunction(&FColor::ToPackedARGB))
|
||||
.Method("ToPackedABGR", MakeFunction(&FColor::ToPackedABGR))
|
||||
.Method("ToPackedRGBA", MakeFunction(&FColor::ToPackedRGBA))
|
||||
.Method("ToPackedBGRA", MakeFunction(&FColor::ToPackedBGRA))
|
||||
.Variable("White", MakeReadonlyVariable(&FColor::White))
|
||||
.Variable("Black", MakeReadonlyVariable(&FColor::Black))
|
||||
.Variable("Transparent", MakeReadonlyVariable(&FColor::Transparent))
|
||||
.Variable("Red", MakeReadonlyVariable(&FColor::Red))
|
||||
.Variable("Green", MakeReadonlyVariable(&FColor::Green))
|
||||
.Variable("Blue", MakeReadonlyVariable(&FColor::Blue))
|
||||
.Variable("Yellow", MakeReadonlyVariable(&FColor::Yellow))
|
||||
.Variable("Cyan", MakeReadonlyVariable(&FColor::Cyan))
|
||||
.Variable("Magenta", MakeReadonlyVariable(&FColor::Magenta))
|
||||
.Variable("Orange", MakeReadonlyVariable(&FColor::Orange))
|
||||
.Variable("Purple", MakeReadonlyVariable(&FColor::Purple))
|
||||
.Variable("Turquoise", MakeReadonlyVariable(&FColor::Turquoise))
|
||||
.Variable("Silver", MakeReadonlyVariable(&FColor::Silver))
|
||||
.Variable("Emerald", MakeReadonlyVariable(&FColor::Emerald))
|
||||
.Register();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,416 +8,33 @@
|
||||
|
||||
// gen by puerts gen tools
|
||||
|
||||
#include "GenHeaders.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DataTransfer.h"
|
||||
#include "JSClassRegister.h"
|
||||
|
||||
static void* _FGuidNew_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
FGuid* Obj = new FGuid();
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FGuidNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 4)
|
||||
{
|
||||
if (Info[0]->IsNumber() && Info[1]->IsNumber() && Info[2]->IsNumber() && Info[3]->IsNumber())
|
||||
{
|
||||
uint32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint32 Arg2 = Info[2]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
uint32 Arg3 = Info[3]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FGuid* Obj = new FGuid(Arg0, Arg1, Arg2, Arg3);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FGuidNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void _FGuidDelete_(void* Ptr, void* ClassData, void* EnvData)
|
||||
{
|
||||
FGuid* Self = static_cast<FGuid*>(Ptr);
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FGuidDelete_:%p"), Self);
|
||||
delete Self;
|
||||
}
|
||||
static void FGuidM_set_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FGuid::M_set_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->operator[](Arg0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidM_get_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FGuid::M_get_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator[](Arg0);
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidM_Invalidate(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FGuid::M_Invalidate] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->Invalidate();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidM_IsValid(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::M_IsValid] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->IsValid();
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidM_ToString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FGuid::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
EGuidFormats Arg0 = EGuidFormats(Info[0]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FGuid::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString(Arg0);
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidS_NewGuid(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto MethodResult = FGuid::NewGuid();
|
||||
void* Ptr = new FGuid(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FGuid>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidS_Parse(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsString() && Info[1]->IsObject() && PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FGuid>(
|
||||
Isolate, PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FString Arg0 = UTF8_TO_TCHAR(*(v8::String::Utf8Value(Isolate, Info[0])));
|
||||
FGuid* Arg1 = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(
|
||||
PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[1])->ToObject(Context).ToLocalChecked());
|
||||
auto MethodResult = FGuid::Parse(Arg0, *Arg1);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FGuidS_ParseExact(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 3)
|
||||
{
|
||||
if (Info[0]->IsString() && Info[1]->IsNumber() && Info[2]->IsObject() &&
|
||||
PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[2])->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FGuid>(
|
||||
Isolate, PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[2])->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FString Arg0 = UTF8_TO_TCHAR(*(v8::String::Utf8Value(Isolate, Info[0])));
|
||||
EGuidFormats Arg1 = EGuidFormats(Info[1]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
FGuid* Arg2 = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(
|
||||
PUERTS_NAMESPACE::DataTransfer::UnRef(Isolate, Info[2])->ToObject(Context).ToLocalChecked());
|
||||
auto MethodResult = FGuid::ParseExact(Arg0, Arg1, *Arg2);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void _FGuidAGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::A] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->A);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FGuid, uint32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FGuidASet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::A] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->A = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FGuidBGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::B] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->B);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FGuid, uint32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FGuidBSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::B] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->B = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FGuidCGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::C] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->C);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FGuid, uint32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FGuidCSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::C] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->C = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FGuidDGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::D] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->D);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FGuid, uint32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FGuidDSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FGuid>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FGuid::D] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->D = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
#include "UsingTypeDecl.hpp"
|
||||
|
||||
struct AutoRegisterForFGuid
|
||||
{
|
||||
AutoRegisterForFGuid()
|
||||
{
|
||||
PUERTS_NAMESPACE::JSClassDefinition Def = JSClassEmptyDefinition;
|
||||
|
||||
static PUERTS_NAMESPACE::JSPropertyInfo Properties[] = {{"A", _FGuidAGet_, _FGuidASet_}, {"B", _FGuidBGet_, _FGuidBSet_},
|
||||
{"C", _FGuidCGet_, _FGuidCSet_}, {"D", _FGuidDGet_, _FGuidDSet_}, {0, 0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Methods[] = {{"set_Item", FGuidM_set_Item}, {"get_Item", FGuidM_get_Item},
|
||||
{"Invalidate", FGuidM_Invalidate}, {"IsValid", FGuidM_IsValid}, {"ToString", FGuidM_ToString}, {0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Functions[] = {
|
||||
{"NewGuid", FGuidS_NewGuid}, {"Parse", FGuidS_Parse}, {"ParseExact", FGuidS_ParseExact}, {0, 0}};
|
||||
|
||||
Def.UETypeName = "Guid";
|
||||
|
||||
Def.SetInitialize(_FGuidNew_);
|
||||
Def.Finalize = _FGuidDelete_;
|
||||
Def.Properties = Properties;
|
||||
Def.Methods = Methods;
|
||||
Def.Functions = Functions;
|
||||
|
||||
PUERTS_NAMESPACE::RegisterJSClass(Def);
|
||||
puerts::DefineClass<FGuid>()
|
||||
.Constructor(CombineConstructors(MakeConstructor(FGuid), MakeConstructor(FGuid, uint32, uint32, uint32, uint32)))
|
||||
.Property("A", MakeProperty(&FGuid::A))
|
||||
.Property("B", MakeProperty(&FGuid::B))
|
||||
.Property("C", MakeProperty(&FGuid::C))
|
||||
.Property("D", MakeProperty(&FGuid::D))
|
||||
.Method("set_Item", SelectFunction(uint32 & (FGuid::*) (int32), &FGuid::operator[]))
|
||||
.Method("get_Item", SelectFunction(const uint32& (FGuid::*) (int32) const, &FGuid::operator[]))
|
||||
.Method("Invalidate", MakeFunction(&FGuid::Invalidate))
|
||||
.Method("IsValid", MakeFunction(&FGuid::IsValid))
|
||||
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION > 2
|
||||
.Method("ToString", MakeFunction(&FGuid::ToString, EGuidFormats::Digits))
|
||||
#else
|
||||
.Method("ToString", CombineOverloads(MakeOverload(FString(FGuid::*)() const, &FGuid::ToString),
|
||||
MakeOverload(FString(FGuid::*)(EGuidFormats Format) const, &FGuid::ToString)))
|
||||
#endif
|
||||
.Function("NewGuid", MakeFunction(&FGuid::NewGuid))
|
||||
.Function("Parse", MakeFunction(&FGuid::Parse))
|
||||
.Function("ParseExact", MakeFunction(&FGuid::ParseExact))
|
||||
.Register();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,717 +8,44 @@
|
||||
|
||||
// gen by puerts gen tools
|
||||
|
||||
#include "GenHeaders.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DataTransfer.h"
|
||||
#include "JSClassRegister.h"
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 60,
|
||||
// column 15> unsupported method : operator() const int32 &(int32) __attribute__((thiscall)) const
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 68,
|
||||
// column 9> unsupported method : operator() int32 &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 92,
|
||||
// column 13> unsupported method : operator*= FIntPoint &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 100,
|
||||
// column 13> unsupported method : operator/= FIntPoint &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 108,
|
||||
// column 13> unsupported method : operator+= FIntPoint &(const FIntPoint &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 116,
|
||||
// column 13> unsupported method : operator-= FIntPoint &(const FIntPoint &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 124,
|
||||
// column 13> unsupported method : operator/= FIntPoint &(const FIntPoint &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntPoint.h', line 132,
|
||||
// column 13> unsupported method : operator= FIntPoint &(const FIntPoint &) __attribute__((thiscall))
|
||||
|
||||
static void* _FIntPointNew_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
FIntPoint* Obj = new FIntPoint();
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntPointNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsNumber() && Info[1]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FIntPoint* Obj = new FIntPoint(Arg0, Arg1);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntPointNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
EForceInit Arg0 = EForceInit(Info[0]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
FIntPoint* Obj = new FIntPoint(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntPointNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void _FIntPointDelete_(void* Ptr, void* ClassData, void* EnvData)
|
||||
{
|
||||
FIntPoint* Self = static_cast<FIntPoint*>(Ptr);
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntPointDelete_:%p"), Self);
|
||||
delete Self;
|
||||
}
|
||||
static void FIntPointM_op_Equality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Equality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator==(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_op_Inequality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Inequality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator!=(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_op_Multiply(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Multiply] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator*(Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_op_Division(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Division] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator/(Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Division] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator/(*Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_op_Addition(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Addition] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator+(*Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_op_Subtraction(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_op_Subtraction] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator-(*Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_set_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_set_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->operator[](Arg0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_get_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_get_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator[](Arg0);
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_ComponentMin(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_ComponentMin] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ComponentMin(*Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_ComponentMax(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_ComponentMax] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ComponentMax(*Arg0);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_GetMax(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_GetMax] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetMax();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_GetMin(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_GetMin] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetMin();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_Size(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_Size] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->Size();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_SizeSquared(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_SizeSquared] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->SizeSquared();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointM_ToString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntPoint::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointS_DivideAndRoundUp(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsNumber())
|
||||
{
|
||||
FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto MethodResult = FIntPoint::DivideAndRoundUp(*Arg0, Arg1);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[1]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
FIntPoint* Arg1 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[1]->ToObject(Context).ToLocalChecked());
|
||||
auto MethodResult = FIntPoint::DivideAndRoundUp(*Arg0, *Arg1);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointS_DivideAndRoundDown(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntPoint>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsNumber())
|
||||
{
|
||||
FIntPoint* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto MethodResult = FIntPoint::DivideAndRoundDown(*Arg0, Arg1);
|
||||
void* Ptr = new FIntPoint(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntPoint>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntPointS_Num(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto MethodResult = FIntPoint::Num();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void _FIntPointXGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntPoint::X] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->X);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FIntPoint, int32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FIntPointXSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntPoint::X] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->X = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FIntPointYGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntPoint::Y] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->Y);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FIntPoint, int32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FIntPointYSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntPoint>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntPoint::Y] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->Y = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
#include "UsingTypeDecl.hpp"
|
||||
|
||||
struct AutoRegisterForFIntPoint
|
||||
{
|
||||
AutoRegisterForFIntPoint()
|
||||
{
|
||||
PUERTS_NAMESPACE::JSClassDefinition Def = JSClassEmptyDefinition;
|
||||
|
||||
static PUERTS_NAMESPACE::JSPropertyInfo Properties[] = {
|
||||
{"X", _FIntPointXGet_, _FIntPointXSet_}, {"Y", _FIntPointYGet_, _FIntPointYSet_}, {0, 0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Methods[] = {{"op_Equality", FIntPointM_op_Equality},
|
||||
{"op_Inequality", FIntPointM_op_Inequality}, {"op_Multiply", FIntPointM_op_Multiply},
|
||||
{"op_Division", FIntPointM_op_Division}, {"op_Addition", FIntPointM_op_Addition},
|
||||
{"op_Subtraction", FIntPointM_op_Subtraction}, {"set_Item", FIntPointM_set_Item}, {"get_Item", FIntPointM_get_Item},
|
||||
{"ComponentMin", FIntPointM_ComponentMin}, {"ComponentMax", FIntPointM_ComponentMax}, {"GetMax", FIntPointM_GetMax},
|
||||
{"GetMin", FIntPointM_GetMin}, {"Size", FIntPointM_Size}, {"SizeSquared", FIntPointM_SizeSquared},
|
||||
{"ToString", FIntPointM_ToString}, {0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Functions[] = {{"DivideAndRoundUp", FIntPointS_DivideAndRoundUp},
|
||||
{"DivideAndRoundDown", FIntPointS_DivideAndRoundDown}, {"Num", FIntPointS_Num}, {0, 0}};
|
||||
|
||||
Def.UETypeName = "IntPoint";
|
||||
|
||||
Def.SetInitialize(_FIntPointNew_);
|
||||
Def.Finalize = _FIntPointDelete_;
|
||||
Def.Properties = Properties;
|
||||
Def.Methods = Methods;
|
||||
Def.Functions = Functions;
|
||||
|
||||
PUERTS_NAMESPACE::RegisterJSClass(Def);
|
||||
puerts::DefineClass<FIntPoint>()
|
||||
.Constructor(CombineConstructors(
|
||||
MakeConstructor(FIntPoint), MakeConstructor(FIntPoint, int32, int32), MakeConstructor(FIntPoint, EForceInit)))
|
||||
.Property("X", MakeProperty(&FIntPoint::X))
|
||||
.Property("Y", MakeProperty(&FIntPoint::Y))
|
||||
.Method("op_Equality", MakeFunction(&FIntPoint::operator==))
|
||||
.Method("op_Inequality", MakeFunction(&FIntPoint::operator!=))
|
||||
.Method("op_Multiply", SelectFunction(FIntPoint(FIntPoint::*)(int32 Scale) const, &FIntPoint::operator*))
|
||||
.Method("op_Division", CombineOverloads(MakeOverload(FIntPoint(FIntPoint::*)(int32) const, &FIntPoint::operator/),
|
||||
MakeOverload(FIntPoint(FIntPoint::*)(const FIntPoint&) const, &FIntPoint::operator/)))
|
||||
.Method("op_Addition", MakeFunction(&FIntPoint::operator+))
|
||||
.Method("op_Subtraction", MakeFunction(&FIntPoint::operator-))
|
||||
.Method("set_Item", SelectFunction(int32 & (FIntPoint::*) (int32), &FIntPoint::operator[]))
|
||||
.Method("get_Item", SelectFunction(int32(FIntPoint::*)(int32) const, &FIntPoint::operator[]))
|
||||
.Method("ComponentMin", MakeFunction(&FIntPoint::ComponentMin))
|
||||
.Method("ComponentMax", MakeFunction(&FIntPoint::ComponentMax))
|
||||
.Method("GetMax", MakeFunction(&FIntPoint::GetMax))
|
||||
.Method("GetMin", MakeFunction(&FIntPoint::GetMin))
|
||||
.Method("Size", MakeFunction(&FIntPoint::Size))
|
||||
.Method("SizeSquared", MakeFunction(&FIntPoint::SizeSquared))
|
||||
.Method("ToString", MakeFunction(&FIntPoint::ToString))
|
||||
.Function(
|
||||
"DivideAndRoundUp", CombineOverloads(MakeOverload(FIntPoint(*)(FIntPoint, int32), &FIntPoint::DivideAndRoundUp),
|
||||
MakeOverload(FIntPoint(*)(FIntPoint, FIntPoint), &FIntPoint::DivideAndRoundUp)))
|
||||
.Function(
|
||||
"DivideAndRoundDown", SelectFunction(FIntPoint(*)(FIntPoint lhs, int32 Divisor), &FIntPoint::DivideAndRoundDown))
|
||||
.Function("Num", MakeFunction(&FIntPoint::Num))
|
||||
.Variable("ZeroValue", MakeReadonlyVariable(&FIntPoint::ZeroValue))
|
||||
.Variable("NoneValue", MakeReadonlyVariable(&FIntPoint::NoneValue))
|
||||
.Register();
|
||||
}
|
||||
};
|
||||
|
||||
AutoRegisterForFIntPoint _AutoRegisterForFIntPoint_;
|
||||
AutoRegisterForFIntPoint _AutoRegisterForFIntPoint_;
|
||||
|
||||
@@ -8,640 +8,40 @@
|
||||
|
||||
// gen by puerts gen tools
|
||||
|
||||
#include "GenHeaders.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DataTransfer.h"
|
||||
#include "JSClassRegister.h"
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 78,
|
||||
// column 15> unsupported method : operator() const int32 &(int32) __attribute__((thiscall)) const
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 86,
|
||||
// column 9> unsupported method : operator() int32 &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 126,
|
||||
// column 14> unsupported method : operator*= FIntVector &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 134,
|
||||
// column 14> unsupported method : operator/= FIntVector &(int32) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 142,
|
||||
// column 14> unsupported method : operator+= FIntVector &(const FIntVector &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 150,
|
||||
// column 14> unsupported method : operator-= FIntVector &(const FIntVector &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 158,
|
||||
// column 14> unsupported method : operator= FIntVector &(const FIntVector &) __attribute__((thiscall))
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 198,
|
||||
// column 13> unsupported method : operator>> FIntVector (int32) __attribute__((thiscall)) const
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 206,
|
||||
// column 13> unsupported method : operator<< FIntVector (int32) __attribute__((thiscall)) const
|
||||
|
||||
// <SourceLocation file 'D:\\Program Files\\Epic Games\\UE_4.24\\Engine\\Source\\Runtime\\Core\\Public\\Math/IntVector.h', line 214,
|
||||
// column 13> unsupported method : operator& FIntVector (int32) __attribute__((thiscall)) const
|
||||
|
||||
static void* _FIntVectorNew_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
FIntVector* Obj = new FIntVector();
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 3)
|
||||
{
|
||||
if (Info[0]->IsNumber() && Info[1]->IsNumber() && Info[2]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
int32 Arg2 = Info[2]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FIntVector* Obj = new FIntVector(Arg0, Arg1, Arg2);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
FIntVector* Obj = new FIntVector(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
FVector* Arg0 = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
FIntVector* Obj = new FIntVector(*Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
EForceInit Arg0 = EForceInit(Info[0]->ToInt32(Context).ToLocalChecked()->Value());
|
||||
FIntVector* Obj = new FIntVector(Arg0);
|
||||
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorNew_:%p"), Obj);
|
||||
return Obj;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static void _FIntVectorDelete_(void* Ptr, void* ClassData, void* EnvData)
|
||||
{
|
||||
FIntVector* Self = static_cast<FIntVector*>(Ptr);
|
||||
// UE_LOG(LogTemp, Warning, TEXT("_FIntVectorDelete_:%p"), Self);
|
||||
delete Self;
|
||||
}
|
||||
static void FIntVectorM_get_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_get_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator[](Arg0);
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_set_Item(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_set_Item] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
Self->operator[](Arg0);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Equality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntVector* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Equality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator==(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Inequality(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntVector* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Inequality] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator!=(*Arg0);
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Multiply(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Multiply] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator*(Arg0);
|
||||
void* Ptr = new FIntVector(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntVector>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Division(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsNumber())
|
||||
{
|
||||
int32 Arg0 = Info[0]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Division] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator/(Arg0);
|
||||
void* Ptr = new FIntVector(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntVector>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Addition(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntVector* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Addition] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator+(*Arg0);
|
||||
void* Ptr = new FIntVector(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntVector>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_op_Subtraction(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 1)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()))
|
||||
{
|
||||
const FIntVector* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_op_Subtraction] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->operator-(*Arg0);
|
||||
void* Ptr = new FIntVector(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntVector>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_IsZero(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_IsZero] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->IsZero();
|
||||
auto V8Result = v8::Boolean::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_GetMax(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_GetMax] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetMax();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_GetMin(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_GetMin] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->GetMin();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_Size(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_Size] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->Size();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorM_ToString(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(
|
||||
Isolate, "[FIntVector::M_ToString] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto MethodResult = Self->ToString();
|
||||
auto V8Result =
|
||||
v8::String::NewFromUtf8(Isolate, TCHAR_TO_UTF8(*MethodResult), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorS_DivideAndRoundUp(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 2)
|
||||
{
|
||||
if (Info[0]->IsObject() &&
|
||||
|
||||
PUERTS_NAMESPACE::DataTransfer::IsInstanceOf<FIntVector>(Isolate, Info[0]->ToObject(Context).ToLocalChecked()) &&
|
||||
Info[1]->IsNumber())
|
||||
{
|
||||
FIntVector* Arg0 =
|
||||
PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info[0]->ToObject(Context).ToLocalChecked());
|
||||
int32 Arg1 = Info[1]->ToInteger(Context).ToLocalChecked()->Value();
|
||||
auto MethodResult = FIntVector::DivideAndRoundUp(*Arg0, Arg1);
|
||||
void* Ptr = new FIntVector(MethodResult);
|
||||
|
||||
auto V8Result = PUERTS_NAMESPACE::DataTransfer::FindOrAddStruct<FIntVector>(Isolate, Context, Ptr, false);
|
||||
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void FIntVectorS_Num(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
if (Info.Length() == 0)
|
||||
{
|
||||
if (true)
|
||||
{
|
||||
auto MethodResult = FIntVector::Num();
|
||||
auto V8Result = v8::Integer::New(Isolate, MethodResult);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "Invalid argument!");
|
||||
}
|
||||
|
||||
static void _FIntVectorXGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::X] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->X);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FIntVector, int32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FIntVectorXSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::X] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->X = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FIntVectorYGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::Y] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->Y);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FIntVector, int32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FIntVectorYSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::Y] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->Y = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
static void _FIntVectorZGet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::Z] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
|
||||
auto V8Result = v8::Integer::New(Isolate, Self->Z);
|
||||
PUERTS_NAMESPACE::DataTransfer::LinkOuter<FIntVector, int32>(Context, Info.Holder(), V8Result);
|
||||
Info.GetReturnValue().Set(V8Result);
|
||||
}
|
||||
static void _FIntVectorZSet_(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
v8::Isolate* Isolate = Info.GetIsolate();
|
||||
v8::Local<v8::Context> Context = Isolate->GetCurrentContext();
|
||||
|
||||
auto Self = PUERTS_NAMESPACE::DataTransfer::GetPointerFast<FIntVector>(Info.Holder());
|
||||
if (!Self)
|
||||
{
|
||||
PUERTS_NAMESPACE::DataTransfer::ThrowException(Isolate, "[FIntVector::Z] Attempt to access a NULL self pointer");
|
||||
return;
|
||||
}
|
||||
auto Value = Info[0];
|
||||
|
||||
Self->Z = Value->ToInteger(Context).ToLocalChecked()->Value();
|
||||
}
|
||||
#include "UsingTypeDecl.hpp"
|
||||
|
||||
struct AutoRegisterForFIntVector
|
||||
{
|
||||
AutoRegisterForFIntVector()
|
||||
{
|
||||
PUERTS_NAMESPACE::JSClassDefinition Def = JSClassEmptyDefinition;
|
||||
|
||||
static PUERTS_NAMESPACE::JSPropertyInfo Properties[] = {{"X", _FIntVectorXGet_, _FIntVectorXSet_},
|
||||
{"Y", _FIntVectorYGet_, _FIntVectorYSet_}, {"Z", _FIntVectorZGet_, _FIntVectorZSet_}, {0, 0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Methods[] = {{"get_Item", FIntVectorM_get_Item}, {"set_Item", FIntVectorM_set_Item},
|
||||
{"op_Equality", FIntVectorM_op_Equality}, {"op_Inequality", FIntVectorM_op_Inequality},
|
||||
{"op_Multiply", FIntVectorM_op_Multiply}, {"op_Division", FIntVectorM_op_Division},
|
||||
{"op_Addition", FIntVectorM_op_Addition}, {"op_Subtraction", FIntVectorM_op_Subtraction},
|
||||
{"IsZero", FIntVectorM_IsZero}, {"GetMax", FIntVectorM_GetMax}, {"GetMin", FIntVectorM_GetMin},
|
||||
{"Size", FIntVectorM_Size}, {"ToString", FIntVectorM_ToString}, {0, 0}};
|
||||
|
||||
static PUERTS_NAMESPACE::JSFunctionInfo Functions[] = {
|
||||
{"DivideAndRoundUp", FIntVectorS_DivideAndRoundUp}, {"Num", FIntVectorS_Num}, {0, 0}};
|
||||
|
||||
Def.UETypeName = "IntVector";
|
||||
|
||||
Def.SetInitialize(_FIntVectorNew_);
|
||||
Def.Finalize = _FIntVectorDelete_;
|
||||
Def.Properties = Properties;
|
||||
Def.Methods = Methods;
|
||||
Def.Functions = Functions;
|
||||
|
||||
PUERTS_NAMESPACE::RegisterJSClass(Def);
|
||||
puerts::DefineClass<FIntVector>()
|
||||
.Constructor(CombineConstructors(MakeConstructor(FIntVector), MakeConstructor(FIntVector, int32, int32, int32),
|
||||
MakeConstructor(FIntVector, int32), MakeConstructor(FIntVector, FVector), MakeConstructor(FIntVector, EForceInit)))
|
||||
.Property("X", MakeProperty(&FIntVector::X))
|
||||
.Property("Y", MakeProperty(&FIntVector::Y))
|
||||
.Property("Z", MakeProperty(&FIntVector::Z))
|
||||
.Method("get_Item", SelectFunction(const int32& (FIntVector::*) (int32) const, &FIntVector::operator[]))
|
||||
.Method("set_Item", SelectFunction(int32 & (FIntVector::*) (int32), &FIntVector::operator[]))
|
||||
.Method("op_Equality", MakeFunction(&FIntVector::operator==))
|
||||
.Method("op_Inequality", MakeFunction(&FIntVector::operator!=))
|
||||
.Method("op_Multiply", SelectFunction(FIntVector(FIntVector::*)(int32 Scale) const, &FIntVector::operator*))
|
||||
.Method("op_Division", MakeFunction(&FIntVector::operator/))
|
||||
.Method("op_Addition", MakeFunction(&FIntVector::operator+))
|
||||
.Method("op_Subtraction", MakeFunction(&FIntVector::operator-))
|
||||
.Method("IsZero", MakeFunction(&FIntVector::IsZero))
|
||||
.Method("GetMax", MakeFunction(&FIntVector::GetMax))
|
||||
.Method("GetMin", MakeFunction(&FIntVector::GetMin))
|
||||
.Method("Size", MakeFunction(&FIntVector::Size))
|
||||
.Method("ToString", MakeFunction(&FIntVector::ToString))
|
||||
.Function(
|
||||
"DivideAndRoundUp", CombineOverloads(MakeOverload(FIntVector(*)(FIntVector, int32), &FIntVector::DivideAndRoundUp),
|
||||
MakeOverload(FIntVector(*)(FIntVector, FIntVector), &FIntVector::DivideAndRoundUp)))
|
||||
.Function("Num", MakeFunction(&FIntVector::Num))
|
||||
.Variable("ZeroValue", MakeReadonlyVariable(&FIntVector::ZeroValue))
|
||||
.Variable("NoneValue", MakeReadonlyVariable(&FIntVector::NoneValue))
|
||||
.Register();
|
||||
}
|
||||
};
|
||||
|
||||
AutoRegisterForFIntVector _AutoRegisterForFIntVector_;
|
||||
AutoRegisterForFIntVector _AutoRegisterForFIntVector_;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,66 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(ENGINE_INDEPENDENT_JSENV)
|
||||
#include "Engine/NetworkObjectList.h"
|
||||
#include "TimerManager.h"
|
||||
#include "Materials/MaterialInstanceDynamic.h"
|
||||
#include "Containers/Array.h"
|
||||
#include "DisplayDebugHelpers.h"
|
||||
#include "Engine/BlueprintGeneratedClass.h"
|
||||
#include "Engine/ActorChannel.h"
|
||||
#include "Engine/NetConnection.h"
|
||||
#include "Engine/Canvas.h"
|
||||
#include "GameFramework/Actor.h"
|
||||
#include "GameFramework/CameraBlockingVolume.h"
|
||||
#include "GameFramework/Character.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "GameFramework/CheatManager.h"
|
||||
#include "GameFramework/Controller.h"
|
||||
#include "GameFramework/DamageType.h"
|
||||
#include "GameFramework/DebugTextInfo.h"
|
||||
#include "GameFramework/DefaultPawn.h"
|
||||
#include "GameFramework/DefaultPhysicsVolume.h"
|
||||
#include "GameFramework/EngineMessage.h"
|
||||
#include "GameFramework/FloatingPawnMovement.h"
|
||||
#include "GameFramework/ForceFeedbackAttenuation.h"
|
||||
#include "GameFramework/ForceFeedbackEffect.h"
|
||||
#include "GameFramework/GameMode.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "GameFramework/GameNetworkManager.h"
|
||||
#include "GameFramework/GameSession.h"
|
||||
#include "GameFramework/GameState.h"
|
||||
#include "GameFramework/GameStateBase.h"
|
||||
#include "GameFramework/GameUserSettings.h"
|
||||
#include "GameFramework/HUD.h"
|
||||
#include "GameFramework/HUDHitBox.h"
|
||||
#include "GameFramework/Info.h"
|
||||
#include "GameFramework/InputSettings.h"
|
||||
#include "GameFramework/KillZVolume.h"
|
||||
#include "GameFramework/LocalMessage.h"
|
||||
#include "GameFramework/MovementComponent.h"
|
||||
#include "GameFramework/NavMovementComponent.h"
|
||||
#include "GameFramework/OnlineReplStructs.h"
|
||||
#include "GameFramework/OnlineSession.h"
|
||||
#include "GameFramework/PainCausingVolume.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "GameFramework/PawnMovementComponent.h"
|
||||
#include "GameFramework/PhysicsVolume.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "GameFramework/PlayerInput.h"
|
||||
#include "GameFramework/PlayerMuteList.h"
|
||||
#include "GameFramework/PlayerStart.h"
|
||||
#include "GameFramework/PlayerState.h"
|
||||
#include "GameFramework/ProjectileMovementComponent.h"
|
||||
#include "GameFramework/RootMotionSource.h"
|
||||
#include "GameFramework/RotatingMovementComponent.h"
|
||||
#include "GameFramework/SaveGame.h"
|
||||
#include "GameFramework/SimpleReticle.h"
|
||||
#include "GameFramework/SpectatorPawn.h"
|
||||
#include "GameFramework/SpectatorPawnMovement.h"
|
||||
#include "GameFramework/SpringArmComponent.h"
|
||||
#include "GameFramework/TouchInterface.h"
|
||||
#include "GameFramework/Volume.h"
|
||||
#include "GameFramework/WorldSettings.h"
|
||||
|
||||
#include "Runtime/Launch/Resources/Version.h"
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Tencent is pleased to support the open source community by making Puerts available.
|
||||
* Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* Puerts is licensed under the BSD 3-Clause License, except for the third-party components listed in the file 'LICENSE' which may
|
||||
* be subject to their corresponding license terms. This file is subject to the terms and conditions defined in file 'LICENSE',
|
||||
* which is part of this source code package.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Binding.hpp"
|
||||
#include "UEDataBinding.hpp"
|
||||
|
||||
UsingUStruct(FBox2D);
|
||||
UsingUStruct(FVector2D);
|
||||
UsingUStruct(FLinearColor);
|
||||
UsingUStruct(FColor);
|
||||
UsingUStruct(FVector);
|
||||
UsingUStruct(FGuid);
|
||||
UsingUStruct(FIntPoint);
|
||||
UsingUStruct(FIntVector);
|
||||
UsingUStruct(FQuat);
|
||||
UsingUStruct(FRotator);
|
||||
UsingUStruct(FTransform);
|
||||
UsingUStruct(FVector4);
|
||||
UsingUStruct(FPlane);
|
||||
UsingCppType(FFloat16Color);
|
||||
UsingUStruct(FMatrix);
|
||||
UsingContainer(TArray<FVector2D>);
|
||||
UsingUStruct(FIntVector4);
|
||||
@@ -3179,8 +3179,7 @@ std::weak_ptr<int> FJsEnvImpl::GetJsEnvLifeCycleTracker()
|
||||
v8::Local<v8::Value> FJsEnvImpl::AddSoftObjectPtr(
|
||||
v8::Isolate* Isolate, v8::Local<v8::Context> Context, FSoftObjectPtr* SoftObjectPtr, UClass* Class, bool IsSoftClass)
|
||||
{
|
||||
const auto Constructor = SoftObjectPtrTemplate.Get(Isolate)->GetFunction(Context).ToLocalChecked();
|
||||
const auto JSObject = Constructor->NewInstance(Context).ToLocalChecked();
|
||||
const auto JSObject = SoftObjectPtrTemplate.Get(Isolate)->InstanceTemplate()->NewInstance(Context).ToLocalChecked();
|
||||
DataTransfer::SetPointer(Isolate, JSObject, SoftObjectPtr, 0);
|
||||
DataTransfer::SetPointer(Isolate, JSObject, Class, IsSoftClass ? 2 : 1);
|
||||
DataTransfer::SetPointer(Isolate, JSObject, nullptr, IsSoftClass ? 1 : 2);
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
delete Next;
|
||||
}
|
||||
|
||||
V8_INLINE FObjectCacheNode* Find(const void* TypeId_)
|
||||
FObjectCacheNode* Find(const void* TypeId_)
|
||||
{
|
||||
if (TypeId_ == TypeId)
|
||||
{
|
||||
|
||||
@@ -622,15 +622,7 @@ void pesapi_release_value_ref(pesapi_value_ref value_ref)
|
||||
{
|
||||
if (--value_ref->ref_count == 0)
|
||||
{
|
||||
if (value_ref->env_life_cycle_tracker.expired())
|
||||
{
|
||||
#if V8_MAJOR_VERSION < 11
|
||||
value_ref->value_persistent.Empty();
|
||||
value_ref->context_persistent.Empty();
|
||||
value_ref->~pesapi_value_ref__();
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if (!value_ref->env_life_cycle_tracker.expired())
|
||||
{
|
||||
value_ref->~pesapi_value_ref__();
|
||||
}
|
||||
@@ -791,7 +783,7 @@ pesapi_value pesapi_eval(pesapi_env env, const uint8_t* code, size_t code_size,
|
||||
std::vector<char> buff;
|
||||
buff.reserve(code_size + 1);
|
||||
memcpy(buff.data(), code, code_size);
|
||||
buff[code_size] = '\0';
|
||||
buff.data()[code_size] = '\0';
|
||||
v8::Local<v8::String> source = v8::String::NewFromUtf8(isolate, buff.data(), v8::NewStringType::kNormal).ToLocalChecked();
|
||||
#if V8_MAJOR_VERSION > 8
|
||||
v8::ScriptOrigin origin(isolate, url);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "ObjectMapper.h"
|
||||
#include "StructWrapper.h"
|
||||
#if !defined(ENGINE_INDEPENDENT_JSENV)
|
||||
#include "Engine/UserDefinedStruct.h"
|
||||
#include "StructUtils/UserDefinedStruct.h"
|
||||
#endif
|
||||
#include "ArrayBuffer.h"
|
||||
#include "ContainerWrapper.h"
|
||||
|
||||
@@ -70,20 +70,6 @@ public:
|
||||
DataLength = BS->ByteLength();
|
||||
return BS->Data();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static v8::Local<v8::ArrayBuffer> NewArrayBuffer(v8::Local<v8::Context> Context, void* Data, size_t DataLength)
|
||||
{
|
||||
#if defined(HAS_ARRAYBUFFER_NEW_WITHOUT_STL)
|
||||
return v8::ArrayBuffer_New_Without_Stl(Context->GetIsolate(), Data, DataLength);
|
||||
#else
|
||||
#if USING_IN_UNREAL_ENGINE
|
||||
return v8::ArrayBuffer::New(Context->GetIsolate(), Data, DataLength);
|
||||
#else
|
||||
auto Backing = v8::ArrayBuffer::NewBackingStore(Data, DataLength, v8::BackingStore::EmptyDeleter, nullptr);
|
||||
return v8::ArrayBuffer::New(Context->GetIsolate(), std::move(Backing));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
};
|
||||
@@ -123,7 +109,9 @@ public:
|
||||
|
||||
void Close(const v8::FunctionCallbackInfo<v8::Value>& Info);
|
||||
|
||||
void Close(websocketpp::close::status::value const code, std::string const& reason);
|
||||
void Statue(const v8::FunctionCallbackInfo<v8::Value>& Info);
|
||||
|
||||
void CloseImmediately(websocketpp::close::status::value const code, std::string const& reason);
|
||||
|
||||
void PollOne();
|
||||
|
||||
@@ -157,7 +145,7 @@ private:
|
||||
static void OnGarbageCollectedWithFree(const v8::WeakCallbackInfo<V8WebSocketClientImpl>& Data)
|
||||
{
|
||||
// UE_LOG(LogTemp, Warning, TEXT(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> auto gc %p"), Data.GetParameter());
|
||||
Data.GetParameter()->Close(websocketpp::close::status::normal, "");
|
||||
Data.GetParameter()->CloseImmediately(websocketpp::close::status::normal, "");
|
||||
delete Data.GetParameter();
|
||||
}
|
||||
|
||||
@@ -172,7 +160,9 @@ V8WebSocketClientImpl::V8WebSocketClientImpl(v8::Isolate* InIsolate, v8::Local<v
|
||||
websocketpp::lib::shared_ptr<puerts_asio::ssl::context> on_tls_init(websocketpp::connection_hdl)
|
||||
{
|
||||
auto ctx = websocketpp::lib::make_shared<puerts_asio::ssl::context>(websocketpp::lib::puerts_asio::ssl::context::sslv23);
|
||||
ctx->set_verify_mode(puerts_asio::ssl::verify_none);
|
||||
|
||||
websocketpp::lib::error_code ec;
|
||||
ctx->set_verify_mode(puerts_asio::ssl::verify_none, ec);
|
||||
return ctx;
|
||||
}
|
||||
#endif
|
||||
@@ -199,7 +189,7 @@ void V8WebSocketClientImpl::Connect(const v8::FunctionCallbackInfo<v8::Value>& I
|
||||
if (ec)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "could not create connection because: " << ec.message() << std::endl;
|
||||
ss << "could not create connection because: " << ec.message() << "[" << ec.value() << "]" << std::endl;
|
||||
FV8Utils::ThrowException(Isolate, ss.str().c_str());
|
||||
return;
|
||||
}
|
||||
@@ -256,7 +246,7 @@ void V8WebSocketClientImpl::Send(const v8::FunctionCallbackInfo<v8::Value>& Info
|
||||
if (ec)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "could not create connection because: " << ec.message() << std::endl;
|
||||
ss << "could send because: " << ec.message() << "[" << ec.value() << "]" << std::endl;
|
||||
FV8Utils::ThrowException(Isolate, ss.str().c_str());
|
||||
}
|
||||
}
|
||||
@@ -307,14 +297,40 @@ void V8WebSocketClientImpl::Close(const v8::FunctionCallbackInfo<v8::Value>& Inf
|
||||
reason = *v8::String::Utf8Value(InIsolate, Info[1]);
|
||||
}
|
||||
|
||||
Close(code, reason);
|
||||
if (!Handle.expired())
|
||||
{
|
||||
websocketpp::lib::error_code ec;
|
||||
Client.close(Handle, code, reason, ec);
|
||||
if (ec)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "close fail: " << ec.message() << "[" << ec.value() << "]" << std::endl;
|
||||
FV8Utils::ThrowException(Isolate, ss.str().c_str());
|
||||
}
|
||||
}
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
void V8WebSocketClientImpl::Close(websocketpp::close::status::value const code, std::string const& reason)
|
||||
void V8WebSocketClientImpl::Statue(const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
{
|
||||
websocketpp::lib::error_code ec;
|
||||
Client.ping(Handle, "", ec);
|
||||
auto isolate = Info.GetIsolate();
|
||||
auto context = isolate->GetCurrentContext();
|
||||
auto res = v8::Array::New(isolate);
|
||||
|
||||
res->Set(context, 0, v8::Int32::New(isolate, ec.value())).Check();
|
||||
res->Set(context, 1,
|
||||
v8::String::NewFromUtf8(isolate, ec.message().c_str(), v8::NewStringType::kNormal, ec.message().size()).ToLocalChecked());
|
||||
Info.GetReturnValue().Set(res);
|
||||
}
|
||||
|
||||
void V8WebSocketClientImpl::CloseImmediately(websocketpp::close::status::value const code, std::string const& reason)
|
||||
{
|
||||
if (!Handle.expired())
|
||||
{
|
||||
Client.close(Handle, code, reason);
|
||||
websocketpp::lib::error_code ec;
|
||||
Client.close(Handle, code, reason, ec);
|
||||
}
|
||||
Cleanup();
|
||||
}
|
||||
@@ -358,8 +374,10 @@ void V8WebSocketClientImpl::OnMessage(wspp_connection_hdl InHandle, wspp_message
|
||||
}
|
||||
else if (InMessage->get_opcode() == websocketpp::frame::opcode::BINARY)
|
||||
{
|
||||
args[0] = DataTransfer::NewArrayBuffer(
|
||||
GContext.Get(Isolate), (void*) InMessage->get_payload().c_str(), InMessage->get_payload().size());
|
||||
v8::Local<v8::ArrayBuffer> Ab = v8::ArrayBuffer::New(Isolate, InMessage->get_payload().size());
|
||||
void* Buff = DataTransfer::GetArrayBufferData(Ab);
|
||||
::memcpy(Buff, InMessage->get_payload().data(), InMessage->get_payload().size());
|
||||
args[0] = Ab;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -402,7 +420,7 @@ void V8WebSocketClientImpl::OnFail(wspp_connection_hdl InHandle)
|
||||
// must not raise exception in js, recommend just push a pending msg and process later.
|
||||
Handles[ON_FAIL].Get(Isolate)->Call(GContext.Get(Isolate), v8::Undefined(Isolate), 1, args);
|
||||
}
|
||||
Close(websocketpp::close::status::abnormal_close, "");
|
||||
CloseImmediately(websocketpp::close::status::abnormal_close, "");
|
||||
}
|
||||
|
||||
} // namespace PUERTS_NAMESPACE
|
||||
@@ -442,6 +460,13 @@ void InitWebsocketPPWrap(v8::Local<v8::Context> Context)
|
||||
->Close(Info);
|
||||
}));
|
||||
|
||||
WSTemplate->PrototypeTemplate()->Set(v8::String::NewFromUtf8(Isolate, "statue").ToLocalChecked(),
|
||||
v8::FunctionTemplate::New(Isolate,
|
||||
[](const v8::FunctionCallbackInfo<v8::Value>& Info) {
|
||||
static_cast<PUERTS_NAMESPACE::V8WebSocketClientImpl*>(Info.Holder()->GetAlignedPointerFromInternalField(0))
|
||||
->Statue(Info);
|
||||
}));
|
||||
|
||||
WSTemplate->PrototypeTemplate()->Set(v8::String::NewFromUtf8(Isolate, "poll").ToLocalChecked(),
|
||||
v8::FunctionTemplate::New(Isolate,
|
||||
[](const v8::FunctionCallbackInfo<v8::Value>& Info)
|
||||
|
||||
@@ -181,6 +181,24 @@ struct TScriptStructTraits<FPlane>
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TScriptStructTraits<FMatrix>
|
||||
{
|
||||
static UScriptStruct* Get()
|
||||
{
|
||||
return GetScriptStructInCoreUObject(TEXT("Matrix"));
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct TScriptStructTraits<FIntVector4>
|
||||
{
|
||||
static UScriptStruct* Get()
|
||||
{
|
||||
return GetScriptStructInCoreUObject(TEXT("IntVector4"));
|
||||
}
|
||||
};
|
||||
|
||||
template <class...>
|
||||
using ToVoid = void;
|
||||
|
||||
|
||||
@@ -49,6 +49,30 @@
|
||||
} \
|
||||
}
|
||||
|
||||
#define __DefCDataConverter_pesapi_impl(CLS) \
|
||||
namespace PUERTS_NAMESPACE \
|
||||
{ \
|
||||
namespace pesapi_impl \
|
||||
{ \
|
||||
template <> \
|
||||
struct Converter<CLS> \
|
||||
{ \
|
||||
static pesapi_value toScript(pesapi_env env, CLS value) \
|
||||
{ \
|
||||
return pesapi_native_object_to_value(env, DynamicTypeId<CLS>::get(&value), new CLS(value), true); \
|
||||
} \
|
||||
static CLS toCpp(pesapi_env env, pesapi_value value) \
|
||||
{ \
|
||||
return *static_cast<CLS*>(pesapi_get_native_object_ptr(env, value)); \
|
||||
} \
|
||||
static bool accept(pesapi_env env, pesapi_value value) \
|
||||
{ \
|
||||
return pesapi_is_instance_of(env, StaticTypeId<CLS>::get(), value); \
|
||||
} \
|
||||
}; \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace PUERTS_NAMESPACE
|
||||
{
|
||||
namespace pesapi_impl
|
||||
|
||||
@@ -31,18 +31,25 @@
|
||||
&(::PUERTS_NAMESPACE::PropertyWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::getter), \
|
||||
&(::PUERTS_NAMESPACE::PropertyWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::setter), \
|
||||
::PUERTS_NAMESPACE::PropertyWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::info()
|
||||
#define MakePropertyByGetterSetter(Getter, Setter) \
|
||||
&(::PUERTS_NAMESPACE::PropertyGetterWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(Getter), Getter>::getter), \
|
||||
&(::PUERTS_NAMESPACE::PropertySetterWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(Setter), \
|
||||
Setter>::setter), \
|
||||
::PUERTS_NAMESPACE::PropertyGetterSetterInfo<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(Getter), \
|
||||
decltype(Setter)>::info()
|
||||
#define MakeReadonlyProperty(M) \
|
||||
&(::PUERTS_NAMESPACE::PropertyWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::getter), nullptr, \
|
||||
::PUERTS_NAMESPACE::PropertyWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::info()
|
||||
#define MakeVariable(M) MakeProperty(M)
|
||||
#define MakeVariableByGetterSetter(M) MakePropertyByGetterSetter(M)
|
||||
#define MakeReadonlyVariable(M) MakeReadonlyProperty(M)
|
||||
#define MakeFunction(M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
{ \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::callWithDefaultValues( \
|
||||
info, ##__VA_ARGS__); \
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::info( \
|
||||
#define MakeFunction(M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
{ \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M, \
|
||||
false>::callWithDefaultValues(info, ##__VA_ARGS__); \
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M, false>::info( \
|
||||
PUERTS_NAMESPACE::Count(__VA_ARGS__))
|
||||
#define MakeExtension(M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
@@ -52,13 +59,13 @@
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::extensionInfo( \
|
||||
PUERTS_NAMESPACE::Count(__VA_ARGS__))
|
||||
#define SelectFunction(SIGNATURE, M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
{ \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M>::callWithDefaultValues( \
|
||||
info, ##__VA_ARGS__); \
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M>::info( \
|
||||
#define SelectFunction(SIGNATURE, M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
{ \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M, \
|
||||
false>::callWithDefaultValues(info, ##__VA_ARGS__); \
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M, false>::info( \
|
||||
PUERTS_NAMESPACE::Count(__VA_ARGS__))
|
||||
#define SelectFunction_PtrRet(SIGNATURE, M, ...) \
|
||||
[](::PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API::CallbackInfoType info) \
|
||||
@@ -68,10 +75,11 @@
|
||||
}, \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M, true>::info( \
|
||||
PUERTS_NAMESPACE::Count(__VA_ARGS__))
|
||||
#define MakeCheckFunction(M) \
|
||||
&(::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::checkedCall), \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M>::info()
|
||||
#define MakeOverload(SIGNATURE, M) PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M>
|
||||
#define MakeCheckFunction(M) \
|
||||
&(::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M, false>::checkedCall), \
|
||||
::PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, decltype(M), M, false>::info()
|
||||
#define MakeOverload(SIGNATURE, M) \
|
||||
PUERTS_NAMESPACE::FuncCallWrapper<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, SIGNATURE, M, false>
|
||||
#define CombineOverloads(...) \
|
||||
&::PUERTS_NAMESPACE::OverloadsCombiner<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, __VA_ARGS__>::call, \
|
||||
::PUERTS_NAMESPACE::OverloadsCombiner<PUERTS_NAMESPACE::PUERTS_BINDING_IMPL::API, __VA_ARGS__>::length, \
|
||||
@@ -111,6 +119,9 @@
|
||||
#define __DefCDataPointerConverter_HELPER2(CLS, Suffix) __DefCDataPointerConverter_HELPER1(CLS, Suffix)
|
||||
#define __DefObjectType(CLS) __DefObjectType_HELPER2(CLS, PUERTS_BINDING_IMPL)
|
||||
#define __DefCDataPointerConverter(CLS) __DefCDataPointerConverter_HELPER2(CLS, PUERTS_BINDING_IMPL)
|
||||
#define __DefCDataConverter_HELPER1(CLS, Suffix) __DefCDataConverter_##Suffix(CLS)
|
||||
#define __DefCDataConverter_HELPER2(CLS, Suffix) __DefCDataConverter_HELPER1(CLS, Suffix)
|
||||
#define __DefCDataConverter(CLS) __DefCDataConverter_HELPER2(CLS, PUERTS_BINDING_IMPL)
|
||||
#define UsingNamedCppType(CLS, NAME) __DefScriptTTypeName(NAME, CLS) __DefObjectType(CLS) __DefCDataPointerConverter(CLS)
|
||||
|
||||
#define UsingCppType(CLS) UsingNamedCppType(CLS, CLS)
|
||||
|
||||
@@ -379,6 +379,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -418,6 +423,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
if (&Buf != &(Arg.get()))
|
||||
@@ -452,6 +462,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -476,6 +491,15 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
using BuffType = typename std::remove_const<typename std::remove_reference<T>::type>::type;
|
||||
BuffType Buf;
|
||||
|
||||
void SetArgument(BuffType InArg)
|
||||
{
|
||||
Buf = InArg;
|
||||
Arg = Buf;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -501,6 +525,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
API::UpdateRefValue(context, holder, API::template Converter<typename std::decay<T>::type>::toScript(context, Arg));
|
||||
@@ -527,6 +556,11 @@ private:
|
||||
return Arg ? Arg : &Buf;
|
||||
}
|
||||
|
||||
void SetArgument(BuffType InArg)
|
||||
{
|
||||
Buf = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
API::UpdateRefValue(context, holder, API::template Converter<BuffType>::toScript(context, Buf));
|
||||
@@ -551,6 +585,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(T InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -574,6 +613,11 @@ private:
|
||||
return Arg;
|
||||
}
|
||||
|
||||
void SetArgument(typename ArgumentType<T>::type InArg)
|
||||
{
|
||||
Arg = InArg;
|
||||
}
|
||||
|
||||
void SetRef(typename API::ContextType context, typename API::ValueType holder)
|
||||
{
|
||||
}
|
||||
@@ -615,7 +659,7 @@ private:
|
||||
{
|
||||
if (argCount <= Pos)
|
||||
{
|
||||
std::get<Pos>(cppArgHolders).Arg = defaultValue;
|
||||
std::get<Pos>(cppArgHolders).SetArgument(defaultValue);
|
||||
}
|
||||
DefaultValueSetter<0, Pos + 1, FullArgs...>::Set(cppArgHolders, argCount, rest...);
|
||||
}
|
||||
@@ -1458,6 +1502,164 @@ struct PropertyWrapper<API, Ret*, Variable>
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TG, TG, typename Enable = void>
|
||||
struct PropertyGetterWrapper;
|
||||
|
||||
template <typename API, typename Ret, Ret (*fgetter)()>
|
||||
struct PropertyGetterWrapper<API, Ret (*)(), fgetter>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
API::SetReturn(info, DecayTypeConverter<Ret>::toScript(context, fgetter()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename Ins, Ret (Ins::*func)()>
|
||||
struct PropertyGetterWrapper<API, Ret (Ins::*)(), func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
API::SetReturn(info, API::template Converter<Ret>::toScript(context, (self->*func)()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename Ins, Ret (Ins::*func)() const>
|
||||
struct PropertyGetterWrapper<API, Ret (Ins::*)() const, func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
API::SetReturn(info, API::template Converter<Ret>::toScript(context, (self->*func)()));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API>
|
||||
struct PropertyGetterWrapper<API, decltype(nullptr), nullptr>
|
||||
{
|
||||
static void getter(typename API::CallbackInfoType info)
|
||||
{
|
||||
API::ThrowException(info, "not getter for this property!");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TS, TS, typename Enable = void>
|
||||
struct PropertySetterWrapper;
|
||||
|
||||
template <typename API, typename TS, void (*fsetter)(TS)>
|
||||
struct PropertySetterWrapper<API, void (*)(TS), fsetter>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
fsetter(DecayTypeConverter<TS>::toCpp(context, API::GetArg(info, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TS, typename Ins, void (Ins::*func)(TS)>
|
||||
struct PropertySetterWrapper<API, void (Ins::*)(TS), func>
|
||||
{
|
||||
template <typename T>
|
||||
using DecayTypeConverter = typename API::template Converter<typename internal::ConverterDecay<T>::type>;
|
||||
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
auto context = API::GetContext(info);
|
||||
auto self = DecayTypeConverter<Ins*>::toCpp(context, API::GetThis(info));
|
||||
if (!self)
|
||||
{
|
||||
API::ThrowException(info, "access a null object");
|
||||
return;
|
||||
}
|
||||
|
||||
(self->*func)(DecayTypeConverter<TS>::toCpp(context, API::GetArg(info, 0)));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API>
|
||||
struct PropertySetterWrapper<API, decltype(nullptr), nullptr>
|
||||
{
|
||||
static void setter(typename API::CallbackInfoType info)
|
||||
{
|
||||
API::ThrowException(info, "not setter for this property!");
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename TG, typename TS>
|
||||
struct PropertyGetterSetterInfo;
|
||||
|
||||
template <typename API, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (*)(), TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (Ins::*)(), TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TS>
|
||||
struct PropertyGetterSetterInfo<API, Ret (Ins::*)() const, TS>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ret, typename TG>
|
||||
struct PropertyGetterSetterInfo<API, TG, void (*)(Ret)>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename API, typename Ins, typename Ret, typename TG>
|
||||
struct PropertyGetterSetterInfo<API, TG, void (Ins::*)(Ret)>
|
||||
{
|
||||
static const CTypeInfo* info()
|
||||
{
|
||||
return CTypeInfoImpl<Ret, false>::get();
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, typename API, typename RegisterAPI>
|
||||
class ClassDefineBuilder
|
||||
{
|
||||
|
||||
@@ -490,10 +490,10 @@ struct IsUStructHelper<T, Void_t<decltype(&TScriptStructTraits<T>::Get)>> : std:
|
||||
namespace v8_impl
|
||||
{
|
||||
template <typename T>
|
||||
struct Converter<T*,
|
||||
typename std::enable_if<!std::is_convertible<T*, const UObject*>::value && internal::IsUStructHelper<T>::value>::type>
|
||||
struct Converter<T*, typename std::enable_if<!std::is_const<T>::value && !std::is_convertible<T*, const UObject*>::value &&
|
||||
internal::IsUStructHelper<T>::value>::type>
|
||||
{
|
||||
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, T* value)
|
||||
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, const T* value)
|
||||
{
|
||||
return DataTransfer::FindOrAddStruct<T>(context->GetIsolate(), context, (void*) value, true);
|
||||
}
|
||||
@@ -509,10 +509,17 @@ struct Converter<T*,
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Converter<const T*,
|
||||
typename std::enable_if<!std::is_convertible<T*, const UObject*>::value && internal::IsUStructHelper<T>::value>::type>
|
||||
: Converter<T*>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Converter<T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type>
|
||||
{
|
||||
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, T value)
|
||||
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, const T value)
|
||||
{
|
||||
return DataTransfer::FindOrAddStruct<T>(context->GetIsolate(), context, new T(value), false);
|
||||
}
|
||||
@@ -529,6 +536,16 @@ struct Converter<T, typename std::enable_if<internal::IsUStructHelper<T>::value>
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Converter<const T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type> : Converter<T>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace v8_impl
|
||||
|
||||
template <typename T>
|
||||
struct ScriptTypeName<const T, typename std::enable_if<internal::IsUStructHelper<T>::value>::type> : ScriptTypeName<T>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace PUERTS_NAMESPACE
|
||||
@@ -49,6 +49,32 @@
|
||||
} \
|
||||
}
|
||||
|
||||
#define __DefCDataConverter_v8_impl(CLS) \
|
||||
namespace PUERTS_NAMESPACE \
|
||||
{ \
|
||||
namespace v8_impl \
|
||||
{ \
|
||||
template <> \
|
||||
struct Converter<CLS> \
|
||||
{ \
|
||||
static v8::Local<v8::Value> toScript(v8::Local<v8::Context> context, CLS value) \
|
||||
{ \
|
||||
return ::PUERTS_NAMESPACE::DataTransfer::FindOrAddCData( \
|
||||
context->GetIsolate(), context, DynamicTypeId<CLS>::get(&value), new CLS(value), false); \
|
||||
} \
|
||||
static CLS toCpp(v8::Local<v8::Context> context, const v8::Local<v8::Value>& value) \
|
||||
{ \
|
||||
return *::PUERTS_NAMESPACE::DataTransfer::GetPointerFast<CLS>(value.As<v8::Object>()); \
|
||||
} \
|
||||
static bool accept(v8::Local<v8::Context> context, const v8::Local<v8::Value>& value) \
|
||||
{ \
|
||||
return ::PUERTS_NAMESPACE::DataTransfer::IsInstanceOf( \
|
||||
context->GetIsolate(), StaticTypeId<CLS>::get(), value.As<v8::Object>()); \
|
||||
} \
|
||||
}; \
|
||||
} \
|
||||
}
|
||||
|
||||
namespace PUERTS_NAMESPACE
|
||||
{
|
||||
namespace v8_impl
|
||||
|
||||
Reference in New Issue
Block a user