Cute Chess  0.1
Public Member Functions | Protected Member Functions | List of all members
Chess::EuroShogiBoard Class Reference

A board for EuroShogi. More...

#include <euroshogiboard.h>

Inheritance diagram for Chess::EuroShogiBoard:
Chess::ShogiBoard Chess::Board

Public Member Functions

virtual Boardcopy () const
 
virtual QString defaultFenString () const
 
 EuroShogiBoard ()
 
virtual int height () const
 
virtual Result result ()
 
virtual QString variant () const
 
virtual int width () const
 
- Public Member Functions inherited from Chess::ShogiBoard
virtual CoordinateSystem coordinateSystem () const
 
virtual QList< PiecereservePieceTypes () const
 
 ShogiBoard ()
 
virtual bool variantHasDrops () const
 
virtual bool variantHasOptionalPromotions () const
 
- Public Member Functions inherited from Chess::Board
 Board (Zobrist *zobrist)
 
QString fenString (FenNotation notation=XFen) const
 
GenericMove genericMove (const Move &move) const
 
void initialize ()
 
bool isLegalMove (const Move &move)
 
virtual bool isRandomVariant () const
 
bool isRepetition (const Move &move)
 
bool isValidSquare (const Square &square) const
 
quint64 key () const
 
QVector< MovelegalMoves ()
 
void makeMove (const Move &move, BoardTransition *transition=nullptr)
 
Move moveFromGenericMove (const GenericMove &move) const
 
Move moveFromString (const QString &str)
 
QString moveString (const Move &move, MoveNotation notation)
 
Piece pieceAt (const Square &square) const
 
Piece pieceFromSymbol (const QString &pieceSymbol) const
 
QStringList pieceList (Side side) const
 
QString pieceString (int pieceType) const
 
QString pieceSymbol (Piece piece) const
 
int plyCount () const
 
int repeatCount () const
 
QString representation (Piece piece) const
 
int reserveCount (Piece piece) const
 
void reset ()
 
virtual int reversibleMoveCount () const
 
bool setFenString (const QString &fen)
 
Side sideToMove () const
 
QString startingFenString () const
 
Side startingSide () const
 
virtual Result tablebaseResult (unsigned int *dtm=nullptr) const
 
void undoMove ()
 
virtual Side upperCaseSide () const
 
virtual bool variantHasWallSquares () const
 
virtual ~Board ()
 

Protected Member Functions

virtual void generateMovesForPiece (QVarLengthArray< Chess::Move > &moves, int pieceType, int square) const
 
virtual int promotionRank () const
 
virtual bool ranksAreAllowed () const
 
virtual void vInitialize ()
 
- Protected Member Functions inherited from Chess::ShogiBoard
virtual bool hasImpassePointRule () const
 
virtual Result impassePointRule (int points, int pieces) const
 
virtual bool inCheck (Side side, int square=0) const
 
virtual bool isLegalPosition ()
 
virtual QString lanMoveString (const Move &move)
 
virtual Move moveFromLanString (const QString &str)
 
virtual Move moveFromSanString (const QString &str)
 
virtual int normalPieceType (int type) const
 
virtual int promotedPieceType (int type) const
 
virtual int reserveType (int pieceType) const
 
virtual QString sanMoveString (const Move &move)
 
virtual QString vFenString (FenNotation notation) const
 
virtual bool vIsLegalMove (const Move &move)
 
virtual void vMakeMove (const Move &move, BoardTransition *transition)
 
virtual bool vSetFenString (const QStringList &fen)
 
virtual void vUndoMove (const Move &move)
 
- Protected Member Functions inherited from Chess::Board
void addToReserve (const Piece &piece, int count=1)
 
int arraySize () const
 
bool canMove ()
 
virtual int captureType (const Move &move) const
 
Square chessSquare (int index) const
 
Square chessSquare (const QString &str) const
 
void generateDropMoves (QVarLengthArray< Move > &moves, int pieceType) const
 
void generateHoppingMoves (int sourceSquare, const QVarLengthArray< int > &offsets, QVarLengthArray< Move > &moves) const
 
void generateMoves (QVarLengthArray< Move > &moves, int pieceType=Piece::NoPiece) const
 
void generateSlidingMoves (int sourceSquare, const QVarLengthArray< int > &offsets, QVarLengthArray< Move > &moves) const
 
const MovelastMove () const
 
virtual int maxPieceSymbolLength () const
 
bool moveExists (const Move &move) const
 
Piece pieceAt (int square) const
 
bool pieceHasMovement (int pieceType, unsigned movement) const
 
void removeFromReserve (const Piece &piece)
 
void setPieceType (int type, const QString &name, const QString &symbol, unsigned movement=0, const QString &gsymbol=QString())
 
void setSquare (int square, Piece piece)
 
int squareIndex (const Square &square) const
 
int squareIndex (const QString &str) const
 
QString squareString (int index) const
 
QString squareString (const Square &square) const
 
void xorKey (quint64 key)
 

Additional Inherited Members

- Public Types inherited from Chess::Board
enum  CoordinateSystem { NormalCoordinates, InvertedCoordinates }
 
enum  FenNotation { XFen, ShredderFen }
 
enum  MoveNotation { StandardAlgebraic, LongAlgebraic }
 
- Protected Types inherited from Chess::ShogiBoard
enum  ShogiPieceType {
  Pawn = 1, Lance, Knight, SilverGeneral,
  GoldGeneral, Bishop, Rook, King,
  PromotedPawn, PromotedLance, PromotedKnight, PromotedSilver,
  PromotedBishop, PromotedRook
}
 
- Static Protected Attributes inherited from Chess::ShogiBoard
static const unsigned BishopMovement = 4
 
static const unsigned FerzMovement = 16
 
static const unsigned GoldMovement = 512
 
static const unsigned KnightMovement = 2
 
static const unsigned LanceMovement = 128
 
static const unsigned RookMovement = 8
 
static const unsigned SilverMovement = 256
 
static const unsigned WazirMovement = 64
 

Detailed Description

A board for EuroShogi.

EuroShogi is a variant of Shogi which is played on a 8x8 board. In this variant either side begins with King, two (Gold) Generals, two Bishops (on squares of different colours), two Knights, one Rook (on 2nd rank), and eight Pawns on the third rank. Shogi rules apply.

A Knight leaps like a chess Knight, but only in the two forward directions. In contrast to Shogi, a Knight can also move one square sideways. Therefore Knights can be dropped on any empty square of the board.

The promotion zone consists of the three furthest ranks. In case of a position occurring for the third time with the same player to move and the same pieces in hands, the game is drawn. However, if this situation arises from a series of checks, the side giving perpetual check loses the game.

EuroShogi was introduced in 2000 by VladimĂ­r Pribylinec.

Note
Rules: http://en.wikipedia.org/wiki/Euroshogi
See also
ShogiBoard

Constructor & Destructor Documentation

◆ EuroShogiBoard()

Chess::EuroShogiBoard::EuroShogiBoard ( )

Creates a new EuroShogiBoard object.

Member Function Documentation

◆ copy()

Board * Chess::EuroShogiBoard::copy ( ) const
virtual

Creates and returns a deep copy of this board.

Reimplemented from Chess::ShogiBoard.

◆ defaultFenString()

QString Chess::EuroShogiBoard::defaultFenString ( ) const
virtual

Returns the variant's default starting FEN string.

Reimplemented from Chess::ShogiBoard.

◆ generateMovesForPiece()

void Chess::EuroShogiBoard::generateMovesForPiece ( QVarLengthArray< Chess::Move > &  moves,
int  pieceType,
int  square 
) const
protectedvirtual

Generates pseudo-legal moves for a piece of pieceType at square square.

Note
It doesn't matter if square doesn't contain a piece of pieceType, the move generator ignores it.

Reimplemented from Chess::ShogiBoard.

◆ height()

int Chess::EuroShogiBoard::height ( ) const
virtual

Returns the height of the board in squares.

Reimplemented from Chess::ShogiBoard.

◆ promotionRank()

int Chess::EuroShogiBoard::promotionRank ( ) const
protectedvirtual

Returns the lowest (relative) rank of the promotion zone.

Reimplemented from Chess::ShogiBoard.

◆ ranksAreAllowed()

bool Chess::EuroShogiBoard::ranksAreAllowed ( ) const
protectedvirtual

Returns whether the current position has no pieces on forbidden ranks.

Reimplemented from Chess::ShogiBoard.

◆ result()

Result Chess::EuroShogiBoard::result ( )
virtual

Returns the result of the game, or Result::NoResult if the game is in progress.

Reimplemented from Chess::ShogiBoard.

◆ variant()

QString Chess::EuroShogiBoard::variant ( ) const
virtual

Returns the name of the chess variant.

Reimplemented from Chess::ShogiBoard.

◆ vInitialize()

void Chess::EuroShogiBoard::vInitialize ( )
protectedvirtual

Initializes the variant.

This function is called by initialize(). Subclasses shouldn't generally call it by themselves.

Reimplemented from Chess::ShogiBoard.

◆ width()

int Chess::EuroShogiBoard::width ( ) const
virtual

Returns the width of the board in squares.

Reimplemented from Chess::ShogiBoard.


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