BenBot
1.7.5
A chess engine
Loading...
Searching...
No Matches
MoveFormats.hpp
Go to the documentation of this file.
1
/*
2
* ======================================================================================
3
*
4
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7
* ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11
*
12
* ======================================================================================
13
*/
14
20
21
#pragma once
22
23
#include <cstdint>
// IWYU pragma: keep - for std::uint_least8_t
24
#include <expected>
25
#include <
libchess/moves/Move.hpp
>
26
#include <string>
27
#include <string_view>
28
29
namespace
chess::game
{
30
struct
Position
;
31
}
// namespace chess::game
32
33
namespace
chess::notation
{
34
35
using
game::Position;
36
using
moves::Move;
37
42
enum class
MoveFormat
: std::uint_least8_t {
43
Algebraic
,
44
ICCF
,
45
UCI
46
};
47
52
[[nodiscard]]
auto
format_move
(
53
MoveFormat
format,
54
const
Position
& position,
55
Move
move,
56
bool
algPieceTypeAsUTF8 =
false
) -> std::string;
57
62
[[nodiscard]]
auto
parse_move
(
63
MoveFormat
format,
64
const
Position
& position,
65
std::string_view
string
)
66
-> std::expected<Move, std::string>;
67
68
}
// namespace chess::notation
Move.hpp
chess::notation::MoveFormat
MoveFormat
Definition
MoveFormats.hpp:42
chess::notation::parse_move
auto parse_move(MoveFormat format, const Position &position, std::string_view string) -> std::expected< Move, std::string >
chess::notation::format_move
auto format_move(MoveFormat format, const Position &position, Move move, bool algPieceTypeAsUTF8=false) -> std::string
chess::notation::MoveFormat::UCI
@ UCI
UCI notation.
Definition
MoveFormats.hpp:45
chess::notation::MoveFormat::ICCF
@ ICCF
ICCF numeric notation.
Definition
MoveFormats.hpp:44
chess::notation::MoveFormat::Algebraic
@ Algebraic
Algebraic notation.
Definition
MoveFormats.hpp:43
chess::game
Definition
CastlingRights.hpp:28
chess::notation
Definition
Algebraic.hpp:32
chess::game::Position
Definition
Position.hpp:74
chess::moves::Move
Definition
Move.hpp:75
libchess
include
libchess
notation
MoveFormats.hpp
Generated on
for BenBot by
1.16.1