/uci

UCI library written in C++14 to deal with incoming and outgoing UCI commands

Primary LanguageC++MIT LicenseMIT

uci - Universal Chess Interface

See description: http://wbec-ridderkerk.nl/html/UCIProtocol.html In case the website is down, see the description here: https://github.com/sciencefyll/uci/blob/master/description.md

Features

  • Isolated code. Everything exists within the uci namespace.
  • Events or UCI commands has their own event namespace.
  • Unit testing.
  • CMakeList.txt that supports using this repo as a git-submodule.
  • Benchmarks.
  • Well commented code.
  • Wiki with examples. But this is lacking, see also uci_code/main.cpp for more examples.
  • Forwards for different headers.
  • No library requirements except a compiler and c++14.

GUI to ENGINE

  • Commands or event types.
  • Error command or error event type on unknown UCI commands.
  • String parser to convert UCI input to an std::map.
  • Typedefs for easier usage.
  • Utilities to parse strings to int / float / etc.

ENGINE to GUI

  • Simple functions to send messages from ENGINE to GUI.

Using this as a git sub module

When this repo has been added using git submodule add https://github.com/sciencefyll/uci external/uci, you need to link CMAKE to the repo and you are all set.

Example

# This lets you use clean includes: #include "uci/Listener.h"
set(PROJECTNAME_UCI_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/uci/include")

# Link the directory
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/external/uci")

# And when you compile your projects sources, include uci. 
# The uci project requires threading.
target_link_libraries(PROJECTNAME_src uci -lpthread)