示例#1
0
        public static PosTab Combine(params PosTab[] posTabs)
        //TODO: combine ids are not unique
        {
            if (posTabs.Length == 0)
            {
                return(null);
            }

            PosTab any = ArrayTools.Any(posTabs);

            if (any == null)
            {
                return(null);
            }
            PosTab result = new PosTab(any.rect, any.resolution);

            for (int i = 0; i < posTabs.Length; i++)
            {
                PosTab posTab = posTabs[i];
                if (posTab == null)
                {
                    continue;
                }

                for (int c = 0; c < posTab.cells.array.Length; c++)
                {
                    Cell cell = posTab.cells.array[c];
                    for (int p = 0; p < cell.count; p++)
                    {
                        result.Add(cell.poses[p]);
                    }
                }
            }

            return(result);
        }