Add placeholder engine and search

This commit is contained in:
2022-12-23 09:44:57 +01:00
parent a4d5dbbc84
commit bcf4d66c49
6 changed files with 60 additions and 2 deletions

19
BasicEngine.cpp Normal file
View File

@@ -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();
}

23
BasicEngine.hpp Normal file
View File

@@ -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

View File

@@ -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 .)

View File

@@ -1,5 +1,8 @@
#include "EngineFactory.hpp"
#include <memory>
#include "BasicEngine.hpp"
std::unique_ptr<Engine> EngineFactory::createEngine() {
return nullptr;
return std::make_unique<BasicEngine>();
}

3
Search.cpp Normal file
View File

@@ -0,0 +1,3 @@
#include "Search.hpp"

8
Search.hpp Normal file
View File

@@ -0,0 +1,8 @@
#ifndef CHESS_ENGINE_SEARCH_HPP
#define CHESS_ENGINE_SEARCH_HPP
class Search {
};
#endif //CHESS_ENGINE_SEARCH_HPP