X-Git-Url: https://git.hedgecode.org/?p=chesshog.git;a=blobdiff_plain;f=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2Fcommand%2FInfoParams.java;fp=chesshog-uci%2Fsrc%2Fmain%2Fjava%2Forg%2Fhedgecode%2Fchess%2Fuci%2Fcommand%2FInfoParams.java;h=da3c5d8ffced06b10aa9be8b7cdf5660eef824e0;hp=0000000000000000000000000000000000000000;hb=1c1d899a4dc4144e6b8ec93c0afcda09b38b5f6f;hpb=1fbf14530416c16f1c6fa5ee3e589482dd722a5d diff --git a/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/InfoParams.java b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/InfoParams.java new file mode 100644 index 0000000..da3c5d8 --- /dev/null +++ b/chesshog-uci/src/main/java/org/hedgecode/chess/uci/command/InfoParams.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018. 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.command; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Container class for values of UCI command "info". + * + * @author Dmitry Samoshin aka gotty + */ +public final class InfoParams { + + + private static final Pattern INFO_PATTERN = + Pattern.compile( + String.format("^\\s*%s(.*)%s\\s+(%s)(.*)$" /*, ... */ ) + ); + + private InfoParams() { + + } + +/* + + depth|seldepth|time|nodes|pv|multipv|score...|currmove|currmovenumber|hashfull|nps + tbhits|sbhits|cpuload|string|refutation|currline + +*/ + + + public static final class Factory { + + public static InfoParams parse(String option) { + Matcher matcher = INFO_PATTERN.matcher(option); + if (matcher.find()) { +/* + return new InfoParams( + matcher.group(1).trim(), + matcher.group(2).trim(), + matcher.group(3).trim() + ); +*/ + } + return null; + } + + } + + +}