ChessPlusPlus  WIP
cplusplus.com Community Project
chesspp::board::Board::Movements Class Reference

Holds the valid movements for all pieces on the board. More...

#include <Board.hpp>

Public Member Functions

Movements_t::const_iterator begin () const
 Get the beginning iterator of the valid movements. More...
 
Movements_t::const_iterator end () const
 Get the end iterator of the valid movements. More...
 
void add (piece::Piece const &p, Position_t const &tile)
 Adds a valid movement. More...
 
void remove (piece::Piece const &p, Position_t const &tile)
 Removes a valid movement. More...
 

Friends

class ::chesspp::board::Board
 

Detailed Description

Holds the valid movements for all pieces on the board.

There are three different kinds of movements:

  • Trajectory - the locations a piece can move to
  • Capturing - the locations a piece can capture other pieces
  • Capturable - the locations a piece can be captured by other pieces

This class provides a consistent interface for all three types.

Can be iterated over with a range-based for-loop.

Member Function Documentation

void chesspp::board::Board::Movements::add ( piece::Piece const &  p,
Position_t const &  tile 
)

Adds a valid movement.

Movements_t::const_iterator chesspp::board::Board::Movements::begin ( ) const
inline

Get the beginning iterator of the valid movements.

Movements_t::const_iterator chesspp::board::Board::Movements::end ( ) const
inline

Get the end iterator of the valid movements.

void chesspp::board::Board::Movements::remove ( piece::Piece const &  p,
Position_t const &  tile 
)

Removes a valid movement.

Friends And Related Function Documentation

friend class ::chesspp::board::Board
friend

The documentation for this class was generated from the following files: