Class: Games_Chess
Source Location: /Games_Chess-0.8.0/Chess.php
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
addPiece [line 794]
blankBoard [line 361]
canCastleKingside [line 844]
boolean canCastleKingside(
)
|
|
Determine legality of kingside castling
canCastleQueenside [line 854]
boolean canCastleQueenside(
)
|
|
Determine legality of queenside castling
commitTransaction [line 2285]
void commitTransaction(
)
|
|
Remove any possibility of undo.
gameOver [line 520]
getDiagonalColor [line 2077]
void getDiagonalColor(
$square)
|
|
Parameters:
getMessage [line 2138]
string getMessage(
integer
$code, array
$extra)
|
|
Get an error message from the code Future versions of this method will be multi-language
Parameters:
getMoveList [line 509]
array getMoveList(
[boolean
$withChecks = false])
|
|
Get the list of moves in Standard Algebraic Notation Can be used to populate a PGN file.
Parameters:
getPieceLocations [line 1727]
array|PEAR_Error getPieceLocations(
[W|B
$color = null])
|
|
Get the location of all pieces on the board of a certain color Default is the color that is about to move
Parameters:
getPossibleBishopMoves [line 1783]
array getPossibleBishopMoves(
string
$square, [W|B
$color = null])
|
|
Get all legal Bishop moves (checking of the king is not taken into account)
Parameters:
getPossibleKingMoves [line 2033]
array getPossibleKingMoves(
string
$square, [W|B
$color = null], [
$returnCastleMoves = true])
|
|
Get all legal King moves (checking of the king is not taken into account)
Parameters:
getPossibleKnightMoves [line 1758]
array getPossibleKnightMoves(
string
$square, [W|B
$color = null])
|
|
Get all legal Knight moves (checking of the king is not taken into account)
Parameters:
getPossibleMoves [line 1382]
array|PEAR_Error getPossibleMoves(
K|P|Q|R|B|N
$piece, string
$square, [B|W
$color = null], [boolean
$returnCastleMoves = true])
|
|
Get a list of all possible theoretical squares a piece of this nature and color could move to with the current board and game setup. This method will return all valid moves without determining the presence of check
Parameters:
getPossiblePawnMoves [line 1952]
array getPossiblePawnMoves(
string
$square, [W|B
$color = null], [
$enpassant = null])
|
|
Get all legal Pawn moves (checking of the king is not taken into account)
Parameters:
getPossibleQueenMoves [line 1933]
array getPossibleQueenMoves(
string
$square, [W|B
$color = null])
|
|
Get all legal Queen moves (checking of the king is not taken into account)
Parameters:
getPossibleRookMoves [line 1858]
array getPossibleRookMoves(
string
$square, [W|B
$color = null])
|
|
Get all legal Rook moves (checking of the king is not taken into account)
Parameters:
in50MoveDraw [line 660]
Determine whether any pawn move or capture has occurred in the past 50 moves
inBasicDraw [line 680]
Determine the presence of a basic draw as defined by FIDE rules The rule states: 10.4
The game is drawn when one of the following endings arises:
(a) king against king;
(b) king against king with only bishop or knight;
(c) king and bishop against king and bishop, with both bishops
on diagonals of the same colour.
inCheckMate [line 538]
boolean inCheckMate(
[W|B
$color = null])
|
|
Determine whether a side is in checkmate
Parameters:
inDraw [line 616]
boolean inDraw(
[W|B
$color = null])
|
|
Determines the presence of a forced draw
Parameters:
inRepetitionDraw [line 647]
boolean inRepetitionDraw(
)
|
|
Determine whether draw by repetition has happened From FIDE rules: 10.10
The game is drawn, upon a claim by the player having the move, when the
same position, for the third time:
(a) is about to appear, if he first writes the move on his
scoresheet and declares to the arbiter his intention of making
this move; or
(b) has just appeared, the same player having the move each time.
The position is considered the same if pieces of the same kind and
colour occupy the same squares, and if all the possible moves of
all the pieces are the same, including the rights to castle [at
some future time] or to capture a pawn "en passant".This class determines draw by comparing FENs rendered after every move
inStaleMate [line 580]
boolean inStaleMate(
[W|B
$color = null])
|
|
Determine whether a side is in stalemate
Parameters:
isError [line 2261]
boolean isError(
mixed
$err)
|
|
Determines whether the data returned from a method is a PEAR-related error class
Parameters:
isPromoteMove [line 820]
boolean isPromoteMove(
string
$from, string
$to)
|
|
Determine whether moving a piece from one square to another requires a pawn promotion
Parameters:
moveSAN [line 397]
true|PEAR_Error moveSAN(
string
$move)
|
|
Make a move from a Standard Algebraic Notation (SAN) format SAN is just a normal chess move like Na4, instead of the English Notation, like NR4
Overridden in child classes as:
- Games_Chess_Crazyhouse::moveSAN()
- Make a move from a Standard Algebraic Notation (SAN) format
Parameters:
moveSquare [line 491]
true|PEAR_Error moveSquare(
string
$from, string
$to, [string
$promote = ''])
|
|
Move a piece from one square to another, and mark the old square as empty
Parameters:
raiseError [line 2123]
PEAR_Error raiseError(
integer
$code, [array
$extra = array()])
|
|
Parameters:
renderFen [line 743]
string renderFen(
[boolean
$include_moves = true])
|
|
render the FEN notation for the current board
Parameters:
resetGame [line 378]
PEAR_Error|true resetGame(
[false|string
$fen = false])
|
|
Create a new game with the starting position, or from the position specified by $fen
Parameters:
rollbackTransaction [line 2293]
void rollbackTransaction(
)
|
|
Undo any changes to state since startTransaction() was first used
startTransaction [line 2272]
Begin a chess piece transaction Transactions are used to attempt moves that may be revoked later, especially in methods like inCheckMate()
toArray [line 807]
toMove [line 835]
_convertSquareToSAN [line 1277]
string|PEAR_Error _convertSquareToSAN(
string
$from, string
$to, [string
$promote = ''])
|
|
Convert a starting and ending algebraic square into SAN
Parameters:
_getAllPieceLocations [line 1747]
_getCastleSquares [line 1659]
array _getCastleSquares(
string
$square)
|
|
Get a list of all the squares a king could castle to on an empty board WARNING: assumes valid input
Parameters:
_getDiagonalColor [line 2067]
B|W _getDiagonalColor(
string
$square)
|
|
Return the color of a square (black or white)
Parameters:
_getKingSquares [line 1689]
array _getKingSquares(
string
$square)
|
|
Get a list of all the squares a king could move to on an empty board WARNING: assumes valid input
Parameters:
_getKnightSquares [line 1609]
array _getKnightSquares(
string
$square, [boolean
$returnFlatArray = false])
|
|
Get all the squares a knight could move to on an empty board WARNING: assumes valid input
Parameters:
_getQueenSquares [line 1590]
array _getQueenSquares(
string
$square, [boolean
$returnFlatArray = false])
|
|
Get all the squares a queen could go to on a blank board WARNING: assumes valid input
Parameters:
_getRookSquares [line 1524]
array _getRookSquares(
string
$square, [boolean
$returnFlatArray = false])
|
|
Get the set of squares that are diagonals from this square on an empty board. WARNING: assumes valid input
Parameters:
_moveAlgebraic [line 869]
void _moveAlgebraic(
string
$from, string
$to, [string
$promote = ''])
|
|
Move a piece from one square to another, and mark the old square as empty NO validation is performed, use moveSquare() for validation.
Parameters:
_parseMove [line 893]
array _parseMove(
string
$move)
|
|
Parse out the segments of a move (minus any annotations)
Parameters:
_setupStartingPosition [line 969]
_validMove [line 1155]
Documentation generated on Mon, 11 Mar 2019 13:52:42 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|
|