Beispiel #1
0
        public PoolParamData[] GetAllPoolParamData()
        {
            int index = 0;

            PoolParamData[] results = new PoolParamData[dicPoolParam.Count];
            foreach (var poolParamData in dicPoolParam.Values)
            {
                results[index++] = poolParamData;
            }

            return(results);
        }
Beispiel #2
0
        protected override void OnLoad()
        {
            dtPoolParam = GameEntry.DataTable.GetDataTable <DRPoolParam>();
            if (dtPoolParam == null)
            {
                throw new System.Exception("Can not get data table PoolParam");
            }

            dicPoolParam = new Dictionary <int, PoolParamData>();

            DRPoolParam[] dRPoolParams = dtPoolParam.GetAllDataRows();
            foreach (var dRPoolParam in dRPoolParams)
            {
                PoolParamData poolParamData = new PoolParamData(dRPoolParam);
                dicPoolParam.Add(dRPoolParam.Id, poolParamData);
            }
        }
Beispiel #3
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);
            }
        }
        protected override void OnLoad()
        {
            dtItem = GameEntry.DataTable.GetDataTable <DRItem>();
            if (dtItem == null)
            {
                throw new System.Exception("Can not get data table Item");
            }

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

            dicItemData      = new Dictionary <int, ItemData>();
            dicItemGroupData = new Dictionary <int, ItemGroupData>();

            DRItem[] drItems = dtItem.GetAllDataRows();
            foreach (var drItem in drItems)
            {
                ItemGroupData itemGroupData = null;
                if (!dicItemGroupData.TryGetValue(drItem.ItemGroupId, out itemGroupData))
                {
                    DRItemGroup dRItemGroup = dtItemGroup.GetDataRow(drItem.ItemGroupId);
                    if (dRItemGroup == null)
                    {
                        throw new System.Exception("Can not find ItemGroup id :" + drItem.ItemGroupId);
                    }
                    PoolParamData poolParamData = GameEntry.Data.GetData <DataPoolParam>().GetPoolParamData(dRItemGroup.PoolParamId);

                    itemGroupData = new ItemGroupData(dRItemGroup, poolParamData);
                    dicItemGroupData.Add(drItem.ItemGroupId, itemGroupData);
                }

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

                ItemData itemData = new ItemData(drItem, dRAssetsPath, itemGroupData);
                dicItemData.Add(drItem.Id, itemData);
            }
        }