[LIB-9] Separate chesshog-uci module
[chesshog.git] / chesshog-uci / src / main / java / org / hedgecode / chess / uci / UCIConstants.java
1 /*
2  * Copyright (c) 2018-2019. Developed by Hedgecode.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *   http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.hedgecode.chess.uci;
18
19 /**
20  * UCI protocol constants.
21  *
22  * @author Dmitry Samoshin aka gotty
23  */
24 public final class UCIConstants {
25
26     public static final String UCI = "uci";
27     public static final String DEBUG = "debug";
28     public static final String IS_READY = "isready";
29     public static final String SET_OPTION = "setoption";
30     public static final String REGISTER = "register";
31     public static final String UCI_NEW_GAME = "ucinewgame";
32     public static final String POSITION = "position";
33     public static final String GO = "go";
34     public static final String STOP = "stop";
35     public static final String PONDER_HIT = "ponderhit";
36     public static final String QUIT = "quit";
37
38     public static final String ID = "id";
39     public static final String UCI_OK = "uciok";
40     public static final String READY_OK = "readyok";
41     public static final String BEST_MOVE = "bestmove";
42     public static final String COPY_PROTECTION = "copyprotection";
43     public static final String REGISTRATION = "registration";
44     public static final String INFO = "info";
45     public static final String OPTION = "option";
46     public static final String TERMINATE = "terminate";
47
48     public static final String COMMAND_SEP_REGEX = "\\s+";
49
50     public static final String NULLMOVE = "0000";
51     public static final String MOVE_REGEX = "^([a-h][1-8])([a-h][1-8])([nbrq])?$";
52     public static final int MOVE_REGEX_FROM = 1;
53     public static final int MOVE_REGEX_TO = 2;
54     public static final int MOVE_REGEX_PROMOTE = 3;
55
56     public static final String LOCALE_BUNDLE_FILE = "org.hedgecode.chess.uci.LocalStrings";
57
58
59     private UCIConstants() {
60         throw new AssertionError(
61                 "No UCIConstants instances!"
62         );
63     }
64
65 }