@@ -568,7 +568,7 @@ bool EntityDef::loadComponents(const std::string& defFilePath,
568
568
569
569
// 产生一个属性描述实例
570
570
ENTITY_PROPERTY_UID futype = 0 ;
571
- uint32 flags = ENTITY_BASE_DATA_FLAGS | ENTITY_CELL_DATA_FLAGS | ENTITY_CLIENT_DATA_FLAGS;
571
+ uint32 flags = ED_FLAG_BASE | ED_FLAG_CELL_PUBLIC | ENTITY_CLIENT_DATA_FLAGS;
572
572
bool isPersistent = true ;
573
573
bool isIdentifier = false ; // 是否是一个索引键
574
574
uint32 databaseLength = 0 ; // 这个属性在数据库中的长度
@@ -608,25 +608,28 @@ bool EntityDef::loadComponents(const std::string& defFilePath,
608
608
pCompScriptDefModule->isComponentModule (true );
609
609
610
610
EntityDef::__scriptModules.push_back (pCompScriptDefModule);
611
-
612
- pPropertyDescription = addComponentProperty (futype, componentTypeName, componentName, flags, isPersistent, isIdentifier,
613
- indexType, databaseLength, defaultStr, detailLevel, pScriptModule, pCompScriptDefModule);
614
611
}
615
612
else
616
613
{
617
- pPropertyDescription = addComponentProperty (futype, componentTypeName, componentName, flags, isPersistent, isIdentifier,
618
- indexType, databaseLength, defaultStr, detailLevel, pScriptModule, pCompScriptDefModule);
614
+ flags = ED_FLAG_UNKOWN;
619
615
620
- if (! pCompScriptDefModule->hasBase ())
621
- flags &= ~ENTITY_BASE_DATA_FLAGS ;
616
+ if (pCompScriptDefModule->hasBase ())
617
+ flags |= ED_FLAG_BASE ;
622
618
623
- if (! pCompScriptDefModule->hasCell ())
624
- flags &= ~ENTITY_CELL_DATA_FLAGS ;
619
+ if (pCompScriptDefModule->hasCell ())
620
+ flags |= ED_FLAG_CELL_PUBLIC ;
625
621
626
- if (!pCompScriptDefModule->hasClient ())
627
- flags &= ~ENTITY_CLIENT_DATA_FLAGS;
622
+ if (pCompScriptDefModule->hasClient ())
623
+ {
624
+ if (pCompScriptDefModule->hasBase ())
625
+ flags |= ED_FLAG_BASE_AND_CLIENT;
626
+ else
627
+ flags |= (ED_FLAG_ALL_CLIENTS | ED_FLAG_CELL_PUBLIC_AND_OWN | ED_FLAG_OTHER_CLIENTS | ED_FLAG_OWN_CLIENT);
628
+ }
629
+
630
+ pPropertyDescription = addComponentProperty (futype, componentTypeName, componentName, flags, isPersistent, isIdentifier,
631
+ indexType, databaseLength, defaultStr, detailLevel, pScriptModule, pCompScriptDefModule);
628
632
629
- pPropertyDescription->setFlags (flags);
630
633
pScriptModule->addComponentDescription (componentName.c_str (), pCompScriptDefModule);
631
634
continue ;
632
635
}
@@ -664,16 +667,25 @@ bool EntityDef::loadComponents(const std::string& defFilePath,
664
667
return false ;
665
668
}
666
669
667
- if (!pCompScriptDefModule->hasBase ())
668
- flags &= ~ENTITY_BASE_DATA_FLAGS;
670
+ flags = ED_FLAG_UNKOWN;
671
+
672
+ if (pCompScriptDefModule->hasBase ())
673
+ flags |= ED_FLAG_BASE;
669
674
670
- if (! pCompScriptDefModule->hasCell ())
671
- flags &= ~ENTITY_CELL_DATA_FLAGS ;
675
+ if (pCompScriptDefModule->hasCell ())
676
+ flags |= ED_FLAG_CELL_PUBLIC ;
672
677
673
- if (!pCompScriptDefModule->hasClient ())
674
- flags &= ~ENTITY_CLIENT_DATA_FLAGS;
678
+ if (pCompScriptDefModule->hasClient ())
679
+ {
680
+ if (pCompScriptDefModule->hasBase ())
681
+ flags |= ED_FLAG_BASE_AND_CLIENT;
682
+
683
+ if (pCompScriptDefModule->hasCell ())
684
+ flags |= (ED_FLAG_ALL_CLIENTS | ED_FLAG_CELL_PUBLIC_AND_OWN | ED_FLAG_OTHER_CLIENTS | ED_FLAG_OWN_CLIENT);
685
+ }
675
686
676
- pPropertyDescription->setFlags (flags);
687
+ pPropertyDescription = addComponentProperty (futype, componentTypeName, componentName, flags, isPersistent, isIdentifier,
688
+ indexType, databaseLength, defaultStr, detailLevel, pScriptModule, pCompScriptDefModule);
677
689
678
690
pScriptModule->addComponentDescription (componentName.c_str (), pCompScriptDefModule);
679
691
}
0 commit comments