From c14437aa59e0529dc2116b78c5cc07d37470e67b Mon Sep 17 00:00:00 2001 From: walon Date: Tue, 28 Feb 2023 20:36:43 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8DCfg=20DefBean.PreComp?= =?UTF-8?q?ile=E4=B8=ADCollectHierarchyFields=E6=97=B6=E7=94=B1=E4=BA=8E?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E5=8E=9F=E5=9B=A0=E6=9C=89=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E7=A5=96=E7=88=B6=E5=8F=8A=E6=9B=B4=E9=AB=98?= =?UTF-8?q?=E5=B1=82=E7=BA=A7=E7=9A=84=E7=B1=BB=E7=9A=84ParentDefType?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E6=9C=AA=E8=AE=BE=E7=BD=AE=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E6=9C=AA=E8=83=BD=E6=94=B6=E9=9B=86=E5=88=B0=E6=89=80?= =?UTF-8?q?=E6=9C=89=E5=AD=97=E6=AE=B5=E7=9A=84=E6=81=B6=E5=8A=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Job.Cfg/Source/Defs/DefBean.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Luban.Job.Cfg/Source/Defs/DefBean.cs b/src/Luban.Job.Cfg/Source/Defs/DefBean.cs index 6b19972..afe5a3f 100644 --- a/src/Luban.Job.Cfg/Source/Defs/DefBean.cs +++ b/src/Luban.Job.Cfg/Source/Defs/DefBean.cs @@ -158,9 +158,9 @@ namespace Luban.Job.Cfg.Defs return null; } - public override void PreCompile() + private void SetUpParent() { - if (!string.IsNullOrEmpty(Parent)) + if (ParentDefType == null && !string.IsNullOrEmpty(Parent)) { if ((ParentDefType = (DefBean)AssemblyBase.GetDefType(Namespace, Parent)) == null) { @@ -171,7 +171,13 @@ namespace Luban.Job.Cfg.Defs ParentDefType.Children = new List(); } ParentDefType.Children.Add(this); + ((DefBean)ParentDefType).SetUpParent(); } + } + + public override void PreCompile() + { + SetUpParent(); CollectHierarchyFields(HierarchyFields);