35 const std::string& from_str,
40 const auto&
get_from() const noexcept {
return m_from; }
43 const auto&
get_to() const noexcept {
return m_to; }
89std::ostream& operator<<(std::ostream& os, const
piece_action& p) noexcept;
chess_color
A chess piece color.
Definition chess_color.h:10
An action to be done by a piece.
Definition piece_action.h:18
const auto & get_from() const noexcept
Definition piece_action.h:40
auto get_piece_type() const noexcept
Definition piece_action.h:41
const auto & get_to() const noexcept
Definition piece_action.h:43
auto get_action_type() const noexcept
Definition piece_action.h:39
auto get_color() const noexcept
Definition piece_action.h:42
A chess square.
Definition square.h:58
std::vector< piece_action > to_atomic(const piece_action &a)
Convert an action to one or more atomic actions.
Definition piece_action.cpp:335
bool is_atomic(const piece_action &a) noexcept
Is the action atomic, i.e.
Definition piece_action.cpp:73
bool is_double_move(const piece_action &a) noexcept
Is this a pawn moving two squares forward?
Definition piece_action.cpp:66
piece_action get_test_piece_action() noexcept
Get a piece_action to be used in testing.
Definition piece_action.cpp:43
bool has_action_of_type(const std::vector< piece_action > &actions, const piece_action_type t)
Is there at least one action of the specified type?
Definition piece_action.cpp:54
void test_piece_action()
Test the 'piece_action' class and its free functions.
Definition piece_action.cpp:86
std::string to_str(const piece_action &a) noexcept
Convert to string.
Definition piece_action.cpp:390
std::string describe_action(const piece_action &p)
Describe the 'piece_action' in words, e.g. 'move to (3, 4)'.
Definition piece_action.cpp:38
piece_action_type
The type of actions a piece can do.
Definition piece_action_type.h:9
piece_type
The type of chess piece.
Definition piece_type.h:9