Ejemplo n.º 1
0
        public static string GetKifuContent(int kifuID)
        {
            string    content            = "(;";
            DataTable generalInformation = new KifuDAL().SelectKifuByID(kifuID);

            content += "RU[" + generalInformation.Rows[0][0] + "]";  //rule
            content += "SZ[" + generalInformation.Rows[0][1] + "]";  //size
            content += "KM[" + generalInformation.Rows[0][2] + "]";  //komi
            content += "GN[" + generalInformation.Rows[0][3] + "]";  //game name
            content += "EV[" + generalInformation.Rows[0][4] + "]";  //event
            content += "PW[" + generalInformation.Rows[0][5] + "]";  //player white
            content += "WR[" + generalInformation.Rows[0][6] + "]";  //white rank
            content += "PB[" + generalInformation.Rows[0][7] + "]";  //player black
            content += "BR[" + generalInformation.Rows[0][8] + "]";  //black rank
            content += "RE[" + generalInformation.Rows[0][9] + "]";  //result
            content += "DT[" + generalInformation.Rows[0][10] + "]"; //date

            DataTable eventInformation = new KifuEventDAL().SelectByID(kifuID);

            for (int i = 0; i < eventInformation.Rows.Count; i++)
            {
                content += ";" + ((i % 2 == 0) ? "B" : "W") + "[" + eventInformation.Rows[i][2] + "]";
            }
            return(content + ")");
        }
Ejemplo n.º 2
0
        public static int GetLastKifuID()
        {
            DataTable dt = new KifuDAL().SelectLast();

            return(Int32.Parse(dt.Rows[0]["KifuID"].ToString()));
        }