コード例 #1
0
        public void Dequeue(T except)
        {
            lock (locker)
            {
                if (Front.CompareTo(except) == 0)
                {
                    Front = queue.Dequeue();

                    // Make it a circular queue.
                    queue.Enqueue(Front);
                }
            }
        }
コード例 #2
0
        public int CompareTo(AmtDepthStencilStateKey other)
        {
            if (DepthCompareFunction < other.DepthCompareFunction)
            {
                return(-1);
            }

            if (DepthCompareFunction > other.DepthCompareFunction)
            {
                return(1);
            }

            var frontValue = Front.CompareTo(other.Front);

            if (frontValue < 0)
            {
                return(-1);
            }

            if (frontValue > 0)
            {
                return(1);
            }

            var backValue = Back.CompareTo(other.Back);

            if (backValue < 0)
            {
                return(-1);
            }

            if (backValue > 0)
            {
                return(1);
            }


            if (!other.DepthWriteEnabled && DepthWriteEnabled)
            {
                return(-1);
            }
            else if (other.DepthWriteEnabled && !DepthWriteEnabled)
            {
                return(1);
            }
            else
            {
                return(0);
            }
        }