//ライセンス情報はAgeOnフォルダのLISENCEフォルダを参照してください
using System;
using System.Collections.Generic;
using System.Text;

namespace nispi
{
    class BoadListSort
    {
        public static int CompareOrderNum(ThreadData x, ThreadData y)
        {
            //
            if ((x.orderNum.Length == 0) || (y.orderNum.Length == 0))
                return 0;
            if (Int32.Parse(x.orderNum) > Int32.Parse(y.orderNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.orderNum) < Int32.Parse(y.orderNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareOrderNumRev(ThreadData x, ThreadData y)
        {
            //
            if ((x.orderNum.Length == 0) || (y.orderNum.Length == 0))
                return 0;
            if (Int32.Parse(x.orderNum) < Int32.Parse(y.orderNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.orderNum) > Int32.Parse(y.orderNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareResNum(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.resNum) < Int32.Parse(y.resNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.resNum) > Int32.Parse(y.resNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareResNumRev(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.resNum) > Int32.Parse(y.resNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.resNum) < Int32.Parse(y.resNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareReadNum(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.readNum) < Int32.Parse(y.readNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.readNum) > Int32.Parse(y.readNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareReadNumRev(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.readNum) > Int32.Parse(y.readNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.readNum) < Int32.Parse(y.readNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareNoReadNum(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.noReadNum) < Int32.Parse(y.noReadNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.noReadNum) > Int32.Parse(y.noReadNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareNoReadNumRev(ThreadData x, ThreadData y)
        {
            //
            if (Int32.Parse(x.noReadNum) > Int32.Parse(y.noReadNum))
            {
                return 1;
            }
            else if (Int32.Parse(x.noReadNum) < Int32.Parse(y.noReadNum))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareOpenTime(ThreadData x, ThreadData y)
        {
            //
            if (1 == String.Compare(x.openTime, y.openTime, StringComparison.InvariantCulture))//(Int32.Parse(x.open_time) > Int32.Parse(y.open_time))
            {
                return -1;
            }
            else if (-1 == String.Compare(x.openTime, y.openTime, StringComparison.InvariantCulture))//if (Int32.Parse(x.open_time) < Int32.Parse(y.open_time))
            {
                return 1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareOpenTimeRev(ThreadData x, ThreadData y)
        {
            //
            if (-1 == String.Compare(x.openTime, y.openTime, StringComparison.InvariantCulture))//(Int32.Parse(x.open_time) > Int32.Parse(y.open_time))
            {
                return -1;
            }
            else if (1 == String.Compare(x.openTime, y.openTime, StringComparison.InvariantCulture))//if (Int32.Parse(x.open_time) < Int32.Parse(y.open_time))
            {
                return 1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareSpeed(ThreadData x, ThreadData y)
        {
            //
            if (double.Parse(x.speed) < double.Parse(y.speed))
            {
                return -1;
            }
            else if (double.Parse(x.speed) > double.Parse(y.speed))
            {
                return 1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareSpeedRev(ThreadData x, ThreadData y)
        {
            //
            if (double.Parse(x.speed) > double.Parse(y.speed))
            {
                return -1;
            }
            else if (double.Parse(x.speed) < double.Parse(y.speed))
            {
                return 1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareTitle(ThreadData x, ThreadData y)
        {
            if (1 == String.Compare(x.title, y.title, StringComparison.InvariantCulture))
            {
                return 1;
            }
            else if (-1 == String.Compare(x.title, y.title, StringComparison.InvariantCulture))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareTitleRev(ThreadData x, ThreadData y)
        {
            if (-1 == String.Compare(x.title, y.title, StringComparison.InvariantCulture))
            {
                return 1;
            }
            else if (1 == String.Compare(x.title, y.title, StringComparison.InvariantCulture))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareDatUrl(ThreadData x, ThreadData y)
        {
            if (1 == String.Compare(x.datUrl, y.datUrl, StringComparison.InvariantCulture))
            {
                return 1;
            }
            else if (-1 == String.Compare(x.datUrl, y.datUrl, StringComparison.InvariantCulture))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
        public static int CompareDatUrlRev(ThreadData x, ThreadData y)
        {
            if (-1 == String.Compare(x.datUrl, y.datUrl, StringComparison.InvariantCulture))
            {
                return 1;
            }
            else if (1 == String.Compare(x.datUrl, y.datUrl, StringComparison.InvariantCulture))
            {
                return -1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }

        public static int CompareString(string x, string y)
        {
            if (1 == String.Compare(x, y, StringComparison.InvariantCulture))//(Int32.Parse(x.open_time) > Int32.Parse(y.open_time))
            {
                return -1;
            }
            else if (-1 == String.Compare(x, y, StringComparison.InvariantCulture))//if (Int32.Parse(x.open_time) < Int32.Parse(y.open_time))
            {
                return 1;
            }
            else// if (x.res_num == y.res_num)
            {
                return 0;
            }
        }
    }
}
