X-Git-Url: https://git.hedgecode.org/?a=blobdiff_plain;f=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2FUCIConstants.java;fp=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2FUCIConstants.java;h=1fb5004a51ca218310fdf88d20165beace3303d0;hb=1c1d899a4dc4144e6b8ec93c0afcda09b38b5f6f;hp=0000000000000000000000000000000000000000;hpb=1fbf14530416c16f1c6fa5ee3e589482dd722a5d;p=chesshog.git diff --git a/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java new file mode 100644 index 0000000..1fb5004 --- /dev/null +++ b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/UCIConstants.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2018-2019. Developed by Hedgecode. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.hedgecode.chess.uci; + +/** + * UCI protocol constants. + * + * @author Dmitry Samoshin aka gotty + */ +public final class UCIConstants { + + public static final String UCI = "uci"; + public static final String DEBUG = "debug"; + public static final String IS_READY = "isready"; + public static final String SET_OPTION = "setoption"; + public static final String REGISTER = "register"; + public static final String UCI_NEW_GAME = "ucinewgame"; + public static final String POSITION = "position"; + public static final String GO = "go"; + public static final String STOP = "stop"; + public static final String PONDER_HIT = "ponderhit"; + public static final String QUIT = "quit"; + + public static final String ID = "id"; + public static final String UCI_OK = "uciok"; + public static final String READY_OK = "readyok"; + public static final String BEST_MOVE = "bestmove"; + public static final String COPY_PROTECTION = "copyprotection"; + public static final String REGISTRATION = "registration"; + public static final String INFO = "info"; + public static final String OPTION = "option"; + public static final String TERMINATE = "terminate"; + + public static final String COMMAND_SEP_REGEX = "\\s+"; + + public static final String NULLMOVE = "0000"; + public static final String MOVE_REGEX = "^([a-h][1-8])([a-h][1-8])([nbrq])?$"; + public static final int MOVE_REGEX_FROM = 1; + public static final int MOVE_REGEX_TO = 2; + public static final int MOVE_REGEX_PROMOTE = 3; + + public static final String LOCALE_BUNDLE_FILE = "org.hedgecode.chess.uci.LocalStrings"; + + + private UCIConstants() { + throw new AssertionError( + "No UCIConstants instances!" + ); + } + +}