コード例 #1
0
        private void getAllVobObjects(ref Dictionary <zCVob.gVobTypes, List <zCVob> > list, zCTree <zCVob> tree, params zCVob.gVobTypes[] types)
        {
            do
            {
                if (tree.Data != null && tree.Data.Address != 0)
                {
                    zCVob.gVobTypes type     = tree.Data.VTBL;
                    bool            isInList = false;
                    foreach (zCVob.gVobTypes vt in types)
                    {
                        if (vt == type)
                        {
                            isInList = true;
                            break;
                        }
                    }

                    if (isInList)
                    {
                        if (!list.ContainsKey(type))
                        {
                            list.Add(type, new List <zCVob>());
                        }
                        list[type].Add(tree.Data);
                    }
                }

                if (tree.FirstChild != null && tree.FirstChild.Address != 0)
                {
                    getAllVobObjects(ref list, tree.FirstChild, types);
                }
            } while ((tree = tree.Next).Address != 0);
        }
コード例 #2
0
        public List <zCVob> getVobList(zCVob.gVobTypes vobType)
        {
            Dictionary <zCVob.gVobTypes, List <zCVob> > rDic = new Dictionary <zCVob.gVobTypes, List <zCVob> >();

            getAllVobObjects(ref rDic, this.GlobalVobTree, vobType);

            if (rDic.ContainsKey(vobType))
            {
                return(rDic[vobType]);
            }

            return(new List <zCVob>());
        }
コード例 #3
0
        public List <zCVob> getItemList(zCVob.gVobTypes vobType)
        {
            List <zCVob> vobs = new List <zCVob>();

            zCListSort <zCVob> vobList = this.VobList;

            do
            {
                zCVob vob = vobList.Data;

                //Check if vob is item
                if (vob == null || vob.Address == 0 || vob.VTBL != vobType)
                {
                    continue;
                }

                //add the vob to the itemlist
                vobs.Add(vob);
            } while ((vobList = vobList.Next).Address != 0);

            return(vobs);
        }