Ejemplo n.º 1
0
        protected override void OnLoad()
        {
            dtEntity = GameEntry.DataTable.GetDataTable <DREntity>();
            if (dtEntity == null)
            {
                throw new System.Exception("Can not get data table Entity");
            }

            dtEntityGroup = GameEntry.DataTable.GetDataTable <DREntityGroup>();
            if (dtEntityGroup == null)
            {
                throw new System.Exception("Can not get data table EntityGroup");
            }

            dicEntityData      = new Dictionary <int, EntityData>();
            dicEntityGroupData = new Dictionary <int, EntityGroupData>();

            DREntity[] drEntitys = dtEntity.GetAllDataRows();
            foreach (var drEntity in drEntitys)
            {
                EntityGroupData entityGroupData = null;
                if (!dicEntityGroupData.TryGetValue(drEntity.EntityGroupId, out entityGroupData))
                {
                    DREntityGroup dREntityGroup = dtEntityGroup.GetDataRow(drEntity.EntityGroupId);
                    if (dREntityGroup == null)
                    {
                        throw new System.Exception("Can not find EntityGroup id :" + drEntity.EntityGroupId);
                    }
                    PoolParamData poolParamData = GameEntry.Data.GetData <DataPoolParam>().GetPoolParamData(dREntityGroup.PoolParamId);

                    entityGroupData = new EntityGroupData(dREntityGroup, poolParamData);
                    dicEntityGroupData.Add(drEntity.EntityGroupId, entityGroupData);
                }

                DRAssetsPath dRAssetsPath = GameEntry.Data.GetData <DataAssetsPath>().GetDRAssetsPathByAssetsId(drEntity.AssetId);

                EntityData entityData = new EntityData(drEntity, dRAssetsPath, entityGroupData);
                dicEntityData.Add(drEntity.Id, entityData);
            }
        }
Ejemplo n.º 2
0
 public EntityGroupData(DREntityGroup dREntityGroup, PoolParamData poolParamData)
 {
     this.dREntityGroup = dREntityGroup;
     this.poolParamData = poolParamData;
 }