///////////////////////////////////////////////////////////////////////////// // // ChessTypes.h : common definitions and constants for chess classes // // Written by Thomas F. Mooney, III (tfm3@teleproc.com) // Copyright © 1999. // // This code may be used in compiled form in any way you desire. This // file may be redistributed unmodified by any means PROVIDING it is // not sold for profit without the authors written consent, and // providing that this notice and the authors name is included. If // the source code in this file is used in any commercial application // then acknowledgement must be made to the author of this file // (in whatever form you wish). // // This file is provided "as is" with no expressed or implied warranty. // The author accepts no liability if it causes any damage to your // computer, data, etc. // // Please report any bugs/anomalies/suggestions to the author via the // e-mail address listed above. // ///////////////////////////////////////////////////////////////////////////// #if !defined(ChessTypes_h_) #define ChessTypes_h_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 #include #include #include // types for chess positions // and moves typedef std::string EPD; // single EPD typedef std::vector EPD_VECTOR; // vector of EPDs typedef std::list EPD_LIST; // list of EPDs typedef std::vector EPD_BINARY_VECTOR; // vector of compressed EPDs typedef std::list EPD_BINARY_LIST; // list of compressed EPDs typedef std::string PV; // PV - predicted variation typedef std::string SAN; // SAN notation move typedef std::list SAN_LIST; // list of SAN // return codes for calls const int EPD_STATUS_SUCCESS = 0; // indicates success const int EPD_STATUS_WARNING = 4; // indicates warning const int EPD_STATUS_FAILURE = 8; // indicates error // general constants const int FileCount = 8; // Number of files on board const int FileBase = 'a'; // ID of first file const int RankCount = 8; // Number of ranks on board const int RankBase = '1'; // ID of first rank const int EPD_BINARY_LENGTH = 24; // length required for character // buffer for EpdBinary data const char BinaryBlackKing[4] = {'\x00', '\x00', '\x00', '\x00'}; const char BinaryWhiteKingWhiteToMove[4] = {'\x01', '\x00', '\x00', '\x00'}; const char BinaryWhiteKingBlackToMove[4] = {'\x01', '\x01', '\x01', '\x01'}; const char BinaryBlackQueen[4] = {'\x00', '\x00', '\x00', '\x01'}; const char BinaryWhiteQueen[4] = {'\x01', '\x00', '\x00', '\x01'}; const char BinaryBlackRook[4] = {'\x00', '\x00', '\x01', '\x00'}; const char BinaryWhiteRook[4] = {'\x01', '\x00', '\x01', '\x00'}; const char BinaryBlackRookMayCastle[4] = {'\x00', '\x00', '\x01', '\x01'}; const char BinaryWhiteRookMayCastle[4] = {'\x01', '\x00', '\x01', '\x01'}; const char BinaryBlackKnight[4] = {'\x00', '\x01', '\x00', '\x00'}; const char BinaryWhiteKnight[4] = {'\x01', '\x01', '\x00', '\x00'}; const char BinaryBlackBishop[4] = {'\x00', '\x01', '\x00', '\x01'}; const char BinaryWhiteBishop[4] = {'\x01', '\x01', '\x00', '\x01'}; const char BinaryBlackPawn[4] = {'\x00', '\x01', '\x01', '\x00'}; const char BinaryWhitePawn[4] = {'\x01', '\x01', '\x01', '\x00'}; const char BinaryEpPawn[4] = {'\x00', '\x01', '\x01', '\x01'}; #endif // !defined(ChessTypes_h_)