From bcf4d66c4969939ea7d9c2c7949064d6d883af0f Mon Sep 17 00:00:00 2001 From: Arthur Bols Date: Fri, 23 Dec 2022 09:44:57 +0100 Subject: [PATCH] Add placeholder engine and search --- BasicEngine.cpp | 19 +++++++++++++++++++ BasicEngine.hpp | 23 +++++++++++++++++++++++ CMakeLists.txt | 4 +++- EngineFactory.cpp | 5 ++++- Search.cpp | 3 +++ Search.hpp | 8 ++++++++ 6 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 BasicEngine.cpp create mode 100644 BasicEngine.hpp create mode 100644 Search.cpp create mode 100644 Search.hpp diff --git a/BasicEngine.cpp b/BasicEngine.cpp new file mode 100644 index 0000000..4d42ff2 --- /dev/null +++ b/BasicEngine.cpp @@ -0,0 +1,19 @@ +#include "BasicEngine.hpp" + +std::string BasicEngine::name() const { + return mName; +} +std::string BasicEngine::version() const { + return mVersion; +} +std::string BasicEngine::author() const { + return mAuthor; +} +void BasicEngine::newGame() { + +} +PrincipalVariation BasicEngine::pv(const Board &board, const TimeInfo::Optional &timeInfo) { + (void)board; + (void)timeInfo; + return PrincipalVariation(); +} \ No newline at end of file diff --git a/BasicEngine.hpp b/BasicEngine.hpp new file mode 100644 index 0000000..3641271 --- /dev/null +++ b/BasicEngine.hpp @@ -0,0 +1,23 @@ +#ifndef CHESS_ENGINE_BASICENGINE_HPP +#define CHESS_ENGINE_BASICENGINE_HPP + +#include "Engine.hpp" +class BasicEngine final : public Engine { + +public: + + std::string name() const override; + std::string version() const override; + std::string author() const override; + void newGame() override; + PrincipalVariation pv(const Board &board, const TimeInfo::Optional &timeInfo) override; + +private: + + std::string mName = "Egon++"; + std::string mVersion = "1.0~Egon+C"; + std::string mAuthor = "Bols"; + +}; + +#endif //CHESS_ENGINE_BASICENGINE_HPP diff --git a/CMakeLists.txt b/CMakeLists.txt index a5b9b2d..8bceaa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,9 @@ add_library(cplchess_lib OBJECT Uci.cpp BitBoard.cpp MoveGenerator.cpp - BoardState.hpp) + Search.cpp + BasicEngine.cpp +) target_include_directories(cplchess_lib PUBLIC .) diff --git a/EngineFactory.cpp b/EngineFactory.cpp index 72d1c76..d459611 100644 --- a/EngineFactory.cpp +++ b/EngineFactory.cpp @@ -1,5 +1,8 @@ #include "EngineFactory.hpp" +#include +#include "BasicEngine.hpp" + std::unique_ptr EngineFactory::createEngine() { - return nullptr; + return std::make_unique(); } diff --git a/Search.cpp b/Search.cpp new file mode 100644 index 0000000..1b8cceb --- /dev/null +++ b/Search.cpp @@ -0,0 +1,3 @@ +#include "Search.hpp" + + diff --git a/Search.hpp b/Search.hpp new file mode 100644 index 0000000..40f3d56 --- /dev/null +++ b/Search.hpp @@ -0,0 +1,8 @@ +#ifndef CHESS_ENGINE_SEARCH_HPP +#define CHESS_ENGINE_SEARCH_HPP + +class Search { + +}; + +#endif //CHESS_ENGINE_SEARCH_HPP