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 <
libchess/game/Position.hpp
>
25
#include <
libchess/moves/Move.hpp
>
26
#include <
libchess/notation/Algebraic.hpp
>
27
#include <
libchess/notation/ICCF.hpp
>
28
#include <
libchess/notation/UCI.hpp
>
29
#include <string>
30
31
namespace
chess::notation
{
32
33
using
game::Position;
34
using
moves::Move;
35
40
enum class
MoveFormat
: std::uint_least8_t {
41
Algebraic
,
42
ICCF
,
43
UCI
44
};
45
50
[[nodiscard]]
inline
auto
format_move
(
51
const
MoveFormat
format,
52
const
Position
& position,
53
const
Move
move) -> std::string
54
{
55
switch
(format) {
56
case
MoveFormat::Algebraic
:
57
return
to_alg
(position, move);
58
59
case
MoveFormat::ICCF
:
60
return
to_iccf
(move);
61
62
default
: [[fallthrough]];
63
case
MoveFormat::UCI
:
64
return
to_uci
(move);
65
}
66
}
67
68
}
// namespace chess::notation
Algebraic.hpp
ICCF.hpp
Move.hpp
Position.hpp
UCI.hpp
chess::notation::format_move
auto format_move(const MoveFormat format, const Position &position, const Move move) -> std::string
Definition
MoveFormats.hpp:50
chess::notation::MoveFormat
MoveFormat
Definition
MoveFormats.hpp:40
chess::notation::to_iccf
auto to_iccf(Move move) -> std::string
chess::notation::to_uci
auto to_uci(Move move) -> std::string
chess::notation::to_alg
auto to_alg(const Position &position, Move move) -> std::string
chess::notation::MoveFormat::UCI
@ UCI
UCI notation.
Definition
MoveFormats.hpp:43
chess::notation::MoveFormat::ICCF
@ ICCF
ICCF numeric notation.
Definition
MoveFormats.hpp:42
chess::notation::MoveFormat::Algebraic
@ Algebraic
Algebraic notation.
Definition
MoveFormats.hpp:41
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