Esempio n. 1
0
    /** 接受数据 */
    public void onReceivePage(int page, IntObjectMap <KeyData> dic, IntSet changePageSet)
    {
        if (changePageSet != null && !changePageSet.isEmpty())
        {
            changePageSet.forEach(k =>
            {
                //清CD
                _lockDic.put(k, 0);
            });
        }

        SList <KeyData> list = _list;

        if (dic != null)
        {
            dic.forEach((k, v) =>
            {
                ensureSize(k);
                list.set(k, v);
            });

            //有值才刷新
            onRefreshPage(page);
        }
    }
Esempio n. 2
0
    /** 接受数据 */
    public void onReceivePage(int subsectionIndex, int subsectionSubIndex, int page, IntObjectMap <KeyData> dic, IntSet changePageSet)
    {
        CachePageData cachePageData = getCachePageData(subsectionIndex, subsectionSubIndex);

        if (changePageSet != null && !changePageSet.isEmpty())
        {
            changePageSet.forEach(k =>
            {
                //清CD
                cachePageData.lockDic.put(k, 0);
            });
        }

        SList <KeyData> list = cachePageData.list;

        if (dic != null)
        {
            dic.forEach((k, v) =>
            {
                ensureSize(k, list);
                list.set(k, v);
            });

            //有值才刷新
            onRefreshPage(subsectionIndex, subsectionSubIndex, page);
        }
    }
Esempio n. 3
0
    public void init(SList <AttributeOneInfo> list, int size)
    {
        this.size             = size;
        currentToIndex        = new int[size];
        currentDefaultFullSet = new bool[size];
        currentCanOverMax     = new bool[size];
        maxToCurrentMap       = new int[size];
        currentToMaxMap       = new int[size];
        formulaTypeDic        = new int[size][];
        elementToResultDic    = new int[size][];
        increaseToCurrentMap  = new int[size];
        currentToIncreaseMap  = new int[size];
        increaseToIndex       = new int[size];

        needDispatchSet = new bool[size];
        simpleUnitSet   = new bool[size];

        IntList tCurrentList       = new IntList();
        IntList tFormulaResultList = new IntList();
        IntList tNeedDispatchList  = new IntList();
        IntList tIncreaseList      = new IntList();
        IntList tSimpleUnitList    = new IntList();

        IntObjectMap <IntList> tElementToResultDic = new IntObjectMap <IntList>();

        AttributeOneInfo[] values = list.getValues();
        AttributeOneInfo   v;

        for (int i = 0, len = list.size(); i < len; ++i)
        {
            v = values[i];

            int type = v.id;

            //是当前属性
            if (v.currentMaxID > 0)
            {
                currentToIndex[type] = tCurrentList.size();
                tCurrentList.add(type);
                maxToCurrentMap[v.currentMaxID] = type;
                currentToMaxMap[type]           = v.currentMaxID;

                if (v.isCurrentDefaultFull)
                {
                    currentDefaultFullSet[type] = true;
                }

                if (v.isCurrentCanOverMax)
                {
                    currentCanOverMax[type] = true;
                }
            }

            if (v.increaseID > 0)
            {
                increaseToIndex[type] = tIncreaseList.size();
                tIncreaseList.add(type);
                increaseToCurrentMap[type]         = v.increaseID;
                currentToIncreaseMap[v.increaseID] = type;
            }

            if (v.formula != null && v.formula.Length > 0)
            {
                tFormulaResultList.add(type);
                formulaTypeDic[type] = v.formula;

                for (int j = 1; j < v.formula.Length; j++)
                {
                    tElementToResultDic.computeIfAbsent(v.formula[j], k => new IntList()).add(type);
                }
            }

            //以客户端推送方式为准
            if (v.sendSelfType != AttributeSendSelfType.None)
            {
                tNeedDispatchList.add(type);
                needDispatchSet[type] = true;
            }

            if (v.isSimpleUnitNeed)
            {
                tSimpleUnitList.add(type);
                simpleUnitSet[type] = true;
            }
        }

        currentList       = tCurrentList.toArray();
        formulaResultList = tFormulaResultList.toArray();
        needDispatchList  = tNeedDispatchList.toArray();
        increaseList      = tIncreaseList.toArray();

        tElementToResultDic.forEach((k, v2) =>
        {
            elementToResultDic[k] = v2.toArray();
        });

        simpleUnitList = tSimpleUnitList.toArray();
    }