Esempio n. 1
0
        private TList <EmbattleQueue> GetPriorityQueue()
        {
            //根据先攻值排先攻方
            priorityList.QuickSort((a, b) =>
            {
                var result = 0;
                if (a == null && b == null)
                {
                    return(0);
                }
                if (a != null && b == null)
                {
                    return(1);
                }
                if (a == null)
                {
                    return(-1);
                }

                if (a.PriorityNum > b.PriorityNum)
                {
                    result = -1;
                }
                else if (a.PriorityNum < b.PriorityNum)
                {
                    result = 1;
                }
                else
                {
                    if (a.Role < b.Role)
                    {
                        result = -1;
                    }
                    else if (a.Role > b.Role)
                    {
                        result = 1;
                    }
                }
                return(result);
            });
            return(priorityList);
        }