Conquer Chess
Chess and Starcraft combined
Loading...
Searching...
No Matches
Functions
piece_actions.cpp File Reference
#include "piece_actions.h"
#include <algorithm>
#include <cassert>
#include <iostream>
#include <sstream>
Include dependency graph for piece_actions.cpp:

Functions

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.
 
std::vector< piece_actionconcatenate (const std::vector< piece_action > &lhs_actions, const std::vector< piece_action > &rhs_actions)
 Concatenate vectors.
 
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.
 
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?
 
void test_piece_actions ()
 
std::ostream & operator<< (std::ostream &os, const std::vector< piece_action > &p) noexcept
 

Function Documentation

◆ collect_attacked_squares()

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.

◆ concatenate()

std::vector< piece_action > concatenate ( const std::vector< piece_action > &  lhs_actions,
const std::vector< piece_action > &  rhs_actions 
)

Concatenate vectors.

◆ is_in()

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.

◆ is_square_attacked_by()

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?

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const std::vector< piece_action > &  p 
)
noexcept

◆ test_piece_actions()

void test_piece_actions ( )