tartan  1.2.1.0
tt::ex::illegal_move Class Reference

Base class for Board::makeMove() function errors. More...

#include <exceptions.hpp>

Inheritance diagram for tt::ex::illegal_move:
[legend]
Collaboration diagram for tt::ex::illegal_move:
[legend]

Public Member Functions

 illegal_move (const Piece *p, const Piece::Position &to, const std::string &what_arg="Illegal move")
 
const Piecepiece () const
 Get Piece object. More...
 
const Piece::Positionto () const
 Get move target location. 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)
 

Detailed Description

Base class for Board::makeMove() function errors.

Constructor & Destructor Documentation

◆ illegal_move()

tt::ex::illegal_move::illegal_move ( const Piece p,
const Piece::Position to,
const std::string what_arg = "Illegal move" 
)
inline
Parameters
pPiece object that tries to make illegal move
tolocation to which p tried to move
what_argmessage string

Member Function Documentation

◆ piece()

const Piece* tt::ex::illegal_move::piece ( ) const
inline

Get Piece object.

Returns
Piece object that tried to perform illegal move

◆ to()

const Piece::Position& tt::ex::illegal_move::to ( ) const
inline

Get move target location.

Returns
Position to which Piece object tried to move

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