1#ifndef _TARTAN_CHESS_EXCEPTIONS_HPP_
2#define _TARTAN_CHESS_EXCEPTIONS_HPP_
4#include <tartan/chess.hpp>
5#include <tartan/board/exceptions.hpp>
19 const std::string& what_arg =
"Board already has a king"
36 const std::string& what_arg =
"Board does not have a king"
37 ) : tartan(what_arg) { e_color = c; };
63 const std::string& what_arg =
"King is under check after move")
85 const std::string& what_arg =
"King is under checkmate")
Piece position at the Board.
Definition board.hpp:36
Generic board memeber API.
Definition board.hpp:23
Color
Piece color.
Definition board.hpp:30
Thrown when turn cannot be perfomred because of King beeing in check.
Definition exceptions.hpp:52
check(const Piece *p, const Piece::Position &to, const Piece *k, const std::string &what_arg="King is under check after move")
Definition exceptions.hpp:59
const Piece * king() const
Get the King object.
Definition exceptions.hpp:66
Thrown when turn cannot be perfomred because of King is under checkmate.
Definition exceptions.hpp:76
checkmate(const Piece *p, const Piece::Position &to, const Piece *k, const std::string &what_arg="King is under checkmate")
Definition exceptions.hpp:81
Thrown when inserted King is already provided.
Definition exceptions.hpp:15
Thrown when tt::chess::Chessboard has no King object of certain tt::Piece::Color.
Definition exceptions.hpp:27
no_king(Piece::Color c, const std::string &what_arg="Board does not have a king")
Definition exceptions.hpp:34
Piece::Color color() const
Get the King color.
Definition exceptions.hpp:44
Base class for exceptions about pieces.
Definition exceptions.hpp:38
bad_piece(const Piece *p, const std::string &what_arg="Invalid piece")
Definition exceptions.hpp:44
Base class for Board::makeMove() function errors.
Definition exceptions.hpp:141
const Piece::Position & to() const
Get move target location.
Definition exceptions.hpp:166
illegal_move(const Piece *p, const Piece::Position &to, const std::string &what_arg="Illegal move")
Definition exceptions.hpp:149
Base class for all tartan exceptions.
Definition exceptions.hpp:18
Chess related exceptions namespace.
Definition exceptions.hpp:10