Ejemplo n.º 1
0
        //	Returns the time control string in PGN format
        public override string ToString()
        {
            if (!IsValid)
            {
                return("");
            }

            if (Infinite)
            {
                return("inf");
            }

            if (TimePerMove != 0)
            {
                return(string.Format("{0}/move", (double)TimePerMove / 1000.0));
            }

            string str = "";

            if (MovesPerTC > 0)
            {
                str += MovesPerTC.ToString() + "/";
            }
            str += ((double)TimePerTC / 1000.0).ToString();

            if (TimeIncrement > 0)
            {
                str += "+" + ((double)TimeIncrement / 1000.0).ToString();
            }
            return(str);
        }
Ejemplo n.º 2
0
        //	Returns a verbose description of the time control
        public string ToVerboseString()
        {
            if (!IsValid)
            {
                return("");
            }

            string str;

            if (Infinite)
            {
                str = "infinite time";
            }
            else if (TimePerMove != 0)
            {
                str = string.Format("{0} per move", timeString(TimePerMove));
            }
            else if (MovesPerTC != 0)
            {
                str = string.Format("{0} moves in {1}", MovesPerTC.ToString(), timeString(TimePerTC));
            }
            else
            {
                str = timeString(TimePerTC);
            }

            if (TimePerTC != 0 && TimeIncrement != 0)
            {
                str += string.Format(", {0} increment", timeString(TimeIncrement));
            }
            if (NodeLimit != 0)
            {
                str += string.Format(", {0} nodes", nodeString(NodeLimit));
            }
            if (PlyLimit != 0)
            {
                str += string.Format(", {0} plies", PlyLimit.ToString());
            }
            if (ExpiryMargin != 0)
            {
                str += string.Format(", {0} msec margin", ExpiryMargin.ToString());
            }

            return(str);
        }