Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
piece_actions.h
Go to the documentation of this file.
1#ifndef PIECE_ACTIONS_H
2#define PIECE_ACTIONS_H
3
5
6#include "piece_action.h"
7
8#include <iosfwd>
9#include <vector>
10
12std::vector<std::pair<square, chess_color>>
13 collect_attacked_squares(const std::vector<piece_action>& actions);
14
16std::vector<piece_action> concatenate(
17 const std::vector<piece_action>& lhs_actions,
18 const std::vector<piece_action>& rhs_actions
19);
20
22bool is_in(const piece_action& action, const std::vector<piece_action>& actions) noexcept;
23
26 const std::vector<std::pair<square, chess_color>> attacked_squares,
27 const square& s,
28 const chess_color enemy_color
29);
30
31std::ostream& operator<<(std::ostream& os, const std::vector<piece_action>& p) noexcept;
32
34
35#endif // PIECE_ACTIONS_H
chess_color
A chess piece color.
Definition chess_color.h:10
An action to be done by a piece.
Definition piece_action.h:18
A chess square.
Definition square.h:58
void test_piece_actions()
Definition piece_actions.cpp:56
bool is_in(const piece_action &action, const std::vector< piece_action > &actions) noexcept
Determine if an action is part of a collection of actions.
Definition piece_actions.cpp:37
std::vector< piece_action > concatenate(const std::vector< piece_action > &lhs_actions, const std::vector< piece_action > &rhs_actions)
Concatenate vectors.
Definition piece_actions.cpp:22
std::ostream & operator<<(std::ostream &os, const std::vector< piece_action > &p) noexcept
Definition piece_actions.cpp:82
bool is_square_attacked_by(const std::vector< std::pair< square, chess_color > > attacked_squares, const square &s, const chess_color enemy_color)
Is the square attacked by a certain (enemy) color?
Definition piece_actions.cpp:42
std::vector< std::pair< square, chess_color > > collect_attacked_squares(const std::vector< piece_action > &actions)
Collect all the squares that are attacked by each color.
Definition piece_actions.cpp:9