1#ifndef ACTION_HISTORY_H
2#define ACTION_HISTORY_H
20 const std::vector<std::pair<in_game_time, piece_action>>& timed_actions = {}
28 const auto&
get() const noexcept {
return m_timed_actions; }
33 std::vector<std::pair<in_game_time, piece_action>> m_timed_actions;
std::string to_str(const action_history &history) noexcept
Definition action_history.cpp:272
bool operator==(const action_history &lhs, const action_history &rhs) noexcept
Definition action_history.cpp:284
action_history create_action_history_from_pgn(const pgn_game_string &s)
Create an action history from a PGN string.
Definition action_history.cpp:49
void test_action_history()
Test this class and its free functions.
Definition action_history.cpp:184
bool is_enpassantable(const action_history &action_history, const in_game_time when)
Can this piece (i.e.
Definition action_history.cpp:138
std::vector< piece_action > collect_actions_in_timespan(const action_history &history, const in_game_time from, const in_game_time to)
Collect all the actions that started in the timespan.
Definition action_history.cpp:83
const piece_action & get_last_action(const action_history &history)
Definition action_history.cpp:99
action_history create_action_history_from_game(const game &g)
Create an action history from a game.
Definition action_history.cpp:39
action_history merge_action_histories(const std::vector< action_history > histories)
Combine action histories and sort these.
Definition action_history.cpp:165
int get_n_piece_actions(const action_history &r) noexcept
Get the number of moves in the action history.
Definition action_history.cpp:105
std::ostream & operator<<(std::ostream &os, const action_history &history) noexcept
Definition action_history.cpp:289
bool has_actions(const action_history &history) noexcept
Definition action_history.cpp:110
bool is_piece_selected(const action_history &h)
Is this piece selected, according to its action history.
Definition action_history.cpp:146
bool has_just_double_moved(const action_history &action_history, const in_game_time when)
Has this piece (i.e.
Definition action_history.cpp:115
The collected in-game times of actions, in chrononical order.
Definition action_history.h:17
void add_action(const in_game_time &in_game_time, const piece_action &action) noexcept
Add an action, when started.
Definition action_history.cpp:34
const auto & get() const noexcept
Get the collected in-game times of actions, in chrononical order.
Definition action_history.h:28
The game logic.
Definition game.h:28
The in-game time, in chess moves.
Definition in_game_time.h:16
A string that is a PGN notation string of a game.
Definition pgn_game_string.h:14
An action to be done by a piece.
Definition piece_action.h:18