Static Public Member Functions

MoveParser Class Reference

Utility class to create a Move from a string. More...

#include <MoveParser.hpp>

List of all members.

Static Public Member Functions

static Move< ChessBoard::Coordsparse (const std::string &input, int moveColor)

Detailed Description

Utility class to create a Move from a string.

The move can have extra spaces, since they are removed before parsing. A move is characterised by two coordinates (in chess notation, e.g. a letter between 'a' and 'h' and a number between 1 and 8. A fifth letter reprentig a piece can be added, for promition. The accepted letters are : 'q' for queen, 'r' for rook, 'b' for bishop and 'n' for knight.


Member Function Documentation

static Move<ChessBoard::Coords> MoveParser::parse ( const std::string &  input,
int  moveColor 
) [inline, static]

Extracts a Move for Chessboard from a string In case of failure during the parsing process, an invalid move is returned. The validity can be checkes using isLegal()

Parameters:
input the string to parse
moveColor the player color initiating the move
Returns:
the move corresponding to input or an invalid move if the parsing failed

The documentation for this class was generated from the following files:
 All Classes Functions Variables