From 2213c812c0179cf9c5ddf1e0729f52f34a3fe10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A3=AE=E9=9B=A8Plus?= Date: Thu, 16 Jan 2025 10:24:04 +0800 Subject: [PATCH] =?UTF-8?q?[unreal]=E5=AF=B9=E4=BA=8E=E5=8E=9F=E7=94=9Fcpp?= =?UTF-8?q?=E7=BB=91=E5=AE=9A=EF=BC=8C=E8=8B=A5=E6=9C=AA=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E6=9E=84=E9=80=A0=E5=87=BD=E6=95=B0=EF=BC=8C=E5=88=99=E5=9C=A8?= =?UTF-8?q?ts=E5=A3=B0=E6=98=8E=E4=B8=AD=E5=8A=A0=E5=85=A5abstract?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=EF=BC=8C=E5=8F=AF=E4=BB=A5=E5=9C=A8ts?= =?UTF-8?q?=E4=B8=AD=E5=B0=9D=E8=AF=95=E6=9E=84=E9=80=A0=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=8A=A5=E9=94=99=20(#1971)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: morirain --- .../Private/TemplateBindingGenerator.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/unreal/Puerts/Source/DeclarationGenerator/Private/TemplateBindingGenerator.cpp b/unreal/Puerts/Source/DeclarationGenerator/Private/TemplateBindingGenerator.cpp index 096b52e4f4..a94ae86a43 100644 --- a/unreal/Puerts/Source/DeclarationGenerator/Private/TemplateBindingGenerator.cpp +++ b/unreal/Puerts/Source/DeclarationGenerator/Private/TemplateBindingGenerator.cpp @@ -83,7 +83,17 @@ struct FGenImp { if (HasUENamespace(ClassDefinition->ScriptName)) return; - Output << " class " << ClassDefinition->ScriptName; + + Output << " "; + + PUERTS_NAMESPACE::NamedFunctionInfo* ConstructorInfo = ClassDefinition->ConstructorInfos; + const bool IsNoConstructorInfos = !ConstructorInfo || !(ConstructorInfo->Name && ConstructorInfo->Type); + if (IsNoConstructorInfos) + { + Output << "abstract "; + } + + Output << "class " << ClassDefinition->ScriptName; if (ClassDefinition->SuperTypeId) { Output << " extends " << PUERTS_NAMESPACE::FindClassByID(ClassDefinition->SuperTypeId)->ScriptName; @@ -92,7 +102,6 @@ struct FGenImp TSet AddedFunctions; - PUERTS_NAMESPACE::NamedFunctionInfo* ConstructorInfo = ClassDefinition->ConstructorInfos; while (ConstructorInfo && ConstructorInfo->Name && ConstructorInfo->Type) { FStringBuffer Tmp;