Package org.kaminoite.ranka.kido.ipad.tools.sgf.util

Examples of org.kaminoite.ranka.kido.ipad.tools.sgf.util.ErrorMessage


        {
            useByoyomi = true;
            preByoyomi = parseTime(s.substring(0, idx));
            int idx2 = s.indexOf('/');
            if (idx2 <= idx)
                throw new ErrorMessage("Invalid time specification");
            byoyomi = parseTime(s.substring(idx + 1, idx2));
            try
            {
                byoyomiMoves = Integer.parseInt(s.substring(idx2 + 1));
            }
            catch (NumberFormatException e)
            {
                throw new ErrorMessage("Invalid specification for byoyomi"
                                       + " moves");
            }
        }
        if (preByoyomi <= 0)
            throw new ErrorMessage("Pre-byoyomi time must be positive");
        if (useByoyomi)
        {
            if (byoyomi <= 0)
                throw new ErrorMessage("Byoyomi time must be positive");
            if (byoyomiMoves <= 0)
                throw new ErrorMessage("Byoyomi moves must be positive");
            return new TimeSettings(preByoyomi, byoyomi, byoyomiMoves);
        }
        else
            return new TimeSettings(preByoyomi);
    }
View Full Code Here


        {
            return (Long.parseLong(s.trim()) * factor);
        }
        catch (NumberFormatException e)
        {
            throw new ErrorMessage("Invalid time specification: '" + s + "'");
        }
    }
View Full Code Here

TOP

Related Classes of org.kaminoite.ranka.kido.ipad.tools.sgf.util.ErrorMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.