![]() |
Conquer Chess
Chess and Starcraft combined
|
#include "piece_action.h"#include "piece.h"#include "game_coordinate.h"#include <algorithm>#include <cassert>#include <iostream>#include <sstream>
Functions | |
| std::string | describe_action (const piece_action &p) |
| Describe the 'piece_action' in words, e.g. 'move to (3, 4)'. | |
| piece_action | get_test_piece_action () noexcept |
| Get a piece_action to be used in testing. | |
| 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? | |
| bool | is_double_move (const piece_action &a) noexcept |
| Is this a pawn moving two squares forward? | |
| bool | is_atomic (const piece_action &a) noexcept |
| Is the action atomic, i.e. | |
| void | test_piece_action () |
| Test the 'piece_action' class and its free functions. | |
| std::vector< piece_action > | to_atomic (const piece_action &a) |
| Convert an action to one or more atomic actions. | |
| std::string | to_str (const piece_action &a) noexcept |
| Convert to string. | |
| std::string | to_str (const std::vector< piece_action > &actions) noexcept |
| Convert to string, one line per action, no newline at the end. | |
| bool | operator== (const piece_action &lhs, const piece_action &rhs) noexcept |
| bool | operator!= (const piece_action &lhs, const piece_action &rhs) noexcept |
| std::ostream & | operator<< (std::ostream &os, const piece_action &a) noexcept |
| std::string describe_action | ( | const piece_action & | p | ) |
Describe the 'piece_action' in words, e.g. 'move to (3, 4)'.
|
noexcept |
Get a piece_action to be used in testing.
| 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?
|
noexcept |
Is the action atomic, i.e.
it cannot be split up further. For example, moving a queen d1 to d3 is not atomic, as it is split up in d1 -> d2 -> d3
|
noexcept |
Is this a pawn moving two squares forward?
|
noexcept |
|
noexcept |
|
noexcept |
| void test_piece_action | ( | ) |
Test the 'piece_action' class and its free functions.
| std::vector< piece_action > to_atomic | ( | const piece_action & | a | ) |
Convert an action to one or more atomic actions.
|
noexcept |
Convert to string.
|
noexcept |
Convert to string, one line per action, no newline at the end.