tartan  1.2.1.0
tt::chess::ex::no_king Class Reference

Thrown when tt::chess::Chessboard has no King object of certain tt::Piece::Color. More...

#include <exceptions.hpp>

Inheritance diagram for tt::chess::ex::no_king:
[legend]
Collaboration diagram for tt::chess::ex::no_king:
[legend]

Public Member Functions

 no_king (Piece::Color c, const std::string &what_arg="Board does not have a king")
 
Piece::Color color () const
 Get the King color. More...
 
- Public Member Functions inherited from std::logic_error
logic_error (T... args)
 
what (T... args)
 
- Public Member Functions inherited from std::exception
what (T... args)
 
~exception (T... args)
 
operator= (T... args)
 
exception (T... args)
 

Public Attributes

Piece::Color e_color
 

Detailed Description

Thrown when tt::chess::Chessboard has no King object of certain tt::Piece::Color.

Constructor & Destructor Documentation

◆ no_king()

tt::chess::ex::no_king::no_king ( Piece::Color  c,
const std::string what_arg = "Board does not have a king" 
)
inline
Parameters
ccolor of King object that is not present
what_argmessage string

Member Function Documentation

◆ color()

Piece::Color tt::chess::ex::no_king::color ( ) const
inline

Get the King color.

Returns
Non-existent King object color

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