![]() |
Conquer Chess
Chess and Starcraft combined
|
#include "action_history.h"#include "delta_t.h"#include "game_controller.h"#include "pgn_game_string.h"#include "chess_move.h"#include "pieces.h"#include "game.h"#include <algorithm>#include <cassert>#include <iostream>#include <regex>#include <sstream>
Functions | |
| action_history | create_action_history_from_game (const game &g) |
| Create an action history from a game. | |
| action_history | create_action_history_from_pgn (const pgn_game_string &s) |
| Create an action history from a PGN string. | |
| 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. | |
| const piece_action & | get_last_action (const action_history &history) |
| int | get_n_piece_actions (const action_history &r) noexcept |
| Get the number of moves in the action history. | |
| bool | has_actions (const action_history &history) noexcept |
| bool | has_just_double_moved (const action_history &history, const in_game_time when) |
| Has this piece (i.e. | |
| bool | is_enpassantable (const action_history &action_history, const in_game_time when) |
| Can this piece (i.e. | |
| bool | is_piece_selected (const action_history &h) |
| Is this piece selected, according to its action history. | |
| action_history | merge_action_histories (const std::vector< action_history > histories) |
| Combine action histories and sort these. | |
| void | test_action_history () |
| Test this class and its free functions. | |
| std::string | to_str (const action_history &history) noexcept |
| bool | operator== (const action_history &lhs, const action_history &rhs) noexcept |
| std::ostream & | operator<< (std::ostream &os, const action_history &history) noexcept |
| 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.
| action_history create_action_history_from_game | ( | const game & | g | ) |
Create an action history from a game.
| action_history create_action_history_from_pgn | ( | const pgn_game_string & | s | ) |
Create an action history from a PGN string.
| const piece_action & get_last_action | ( | const action_history & | history | ) |
|
noexcept |
Get the number of moves in the action history.
|
noexcept |
| bool has_just_double_moved | ( | const action_history & | action_history, |
| const in_game_time | when | ||
| ) |
Has this piece (i.e.
a pawn) just finish a double move forward last time unit? Only pawns can do this, e.g. e2-e4 or e7-e5 For example, when at t=0.5, e2-e4 is played, from t=1.5 to t=2.5 this function will return true. Before that, the piece was moving After that, it was too long ago for en-passant
| bool is_enpassantable | ( | const action_history & | action_history, |
| const in_game_time | when | ||
| ) |
Can this piece (i.e.
a pawn) be captured by en-passant? Only pawns can do this, e.g. e2-e4 or e7-e5 For example, when at t=0.5, e2-e4 is played, from t=1.5 to t=2.5 this function will return true. Before that, the piece was moving After that, it was too long ago for en-passant
| bool is_piece_selected | ( | const action_history & | h | ) |
Is this piece selected, according to its action history.
| action_history merge_action_histories | ( | const std::vector< action_history > | histories | ) |
Combine action histories and sort these.
|
noexcept |
|
noexcept |
| void test_action_history | ( | ) |
Test this class and its free functions.
|
noexcept |