Пример #1
0
    /// <summary>
    /// 读完所有表后处理
    /// </summary>
    public static void afterReadConfigAll()
    {
        if (_dic == null)
        {
            return;
        }

        RewardConfig[] values;
        RewardConfig   v;

        for (int i = (values = _dic.getValues()).Length - 1; i >= 0; --i)
        {
            if ((v = values[i]) != null)
            {
                if (v.needGrid > 0)
                {
                    continue;
                }

                v.needGrid = v.items.Length;

                if (v.randomListID > 0)
                {
                    v.needGrid += RandomItemListConfig.get(v.randomListID).getNeedGridNum();
                }
            }
        }
    }
Пример #2
0
    /// <summary>
    /// 构造显示数据
    /// </summary>
    protected virtual void makeShowItems(SList <ItemData> list)
    {
        foreach (DIntData v in items)
        {
            list.add(BaseC.logic.createItem(v));
        }

        if (randomListID > 0)
        {
            RandomItemListConfig randomItemListConfig = RandomItemListConfig.get(randomListID);

            foreach (DIntData v in randomItemListConfig.showItems)
            {
                list.add(BaseC.logic.createItem(v));
            }
        }
    }
Пример #3
0
 /** 随机一组物品 */
 public void randomItemList(SList <ItemData> list, int randItemListConfigID, ILogicEntity entity)
 {
     RandomItemListConfig.get(randItemListConfigID).randomList(list, entity);
 }
Пример #4
0
    /// <summary>
    /// 读完所有表后处理
    /// </summary>
    public static void afterReadConfigAll()
    {
        if (_dic == null)
        {
            return;
        }

        RandomItemListConfig[] values;
        RandomItemListConfig   v;

        for (int i = (values = _dic.getValues()).Length - 1; i >= 0; --i)
        {
            if ((v = values[i]) != null)
            {
                switch (v.type)
                {
                case RandomItemListType.SingleItem:
                {
                    int itemID = v.args[0][0];
                    if (itemID > 0 && ItemConfig.get(itemID) == null)
                    {
                        Ctrl.throwError("找不到物品ID", itemID);
                        return;
                    }
                }
                break;

                case RandomItemListType.SingleRandomItem:
                {
                    int randomItemID = v.args[0][0];

                    if (randomItemID > 0 && RandomItemConfig.get(randomItemID) == null)
                    {
                        Ctrl.throwError("找不到随机物品ID", randomItemID);
                        return;
                    }
                }
                break;

                case RandomItemListType.SumProbRandomItem:
                {
                    foreach (int[] v2 in v.args)
                    {
                        if (v2[1] > 0 && RandomItemConfig.get(v2[1]) == null)
                        {
                            Ctrl.throwError("找不到随机物品ID", v2[1]);
                            return;
                        }
                    }
                }
                break;

                case RandomItemListType.WeightRandomList:
                {
                    foreach (int[] v2 in v.args)
                    {
                        if (v2[1] > 0 && RandomItemListConfig.get(v2[1]) == null)
                        {
                            Ctrl.throwError("找不到随机物品组ID", v2[1]);
                            return;
                        }
                    }
                }
                break;
                }

                //直接算出统计
                v.getNeedGridNum();
            }
        }
    }