Games_Chess
[ class tree: Games_Chess ] [ index: Games_Chess ] [ all elements ]

Class: Games_Chess_Losers

Source Location: /Games_Chess-1.0.1/Chess/Losers.php

Class Overview

Games_Chess
   |
   --Games_Chess_Standard
      |
      --Games_Chess_Losers

Losers chess game


Author(s):

Methods


Inherited Variables

Inherited Methods

Class: Games_Chess_Standard

Games_Chess_Standard::addPiece()
Add a piece to the chessboard
Games_Chess_Standard::blankBoard()
Set up a blank chess board
Games_Chess_Standard::inCheck()
Determine whether one side's king is in check by the other side's pieces
Games_Chess_Standard::isBishop()
Determine whether a piece name is a bishop
Games_Chess_Standard::isKing()
Determine whether a piece name is a king
Games_Chess_Standard::isPawn()
Determine whether a piece name is a pawn
Games_Chess_Standard::isRook()
Determine whether a piece name is a rook
Games_Chess_Standard::toArray()
Generate a representation of the chess board and pieces for use as a
Games_Chess_Standard::_getAllPieceLocations()
Get the location of every piece on the board of color $color
Games_Chess_Standard::_getAllPieceSquares()
Retrieve the locations of all pieces of the same type as $piece
Games_Chess_Standard::_getColor()
Retrieve the color of a piece from its name
Games_Chess_Standard::_getKing()
Get the location of the king
Games_Chess_Standard::_getPiece()
Get the location of a piece
Games_Chess_Standard::_getPieceTypes()
Get a list of all pieces on the board organized by the type of piece, and the color of the square the piece is on.
Games_Chess_Standard::_getPossibleChecks()
Used to determine check
Games_Chess_Standard::_isKnight()
Determine whether a piece name is a knight
Games_Chess_Standard::_isQueen()
Determine whether a piece name is a queen
Games_Chess_Standard::_renderFen()
Render the current board position into Forsyth-Edwards Notation
Games_Chess_Standard::_setupStartingPosition()
Set up a starting position for a new chess game
Games_Chess_Standard::_squareToPiece()
Translate an algebraic coordinate into the color and name of a piece,
Games_Chess_Standard::_takePiece()
Mark a piece as having been taken. No validation is performed

Class: Games_Chess

Games_Chess::addPiece()
Add a piece to the chessboard
Games_Chess::blankBoard()
Create a blank chessboard with no pieces on it
Games_Chess::canCastleKingside()
Determine legality of kingside castling
Games_Chess::canCastleQueenside()
Determine legality of queenside castling
Games_Chess::commitTransaction()
Remove any possibility of undo.
Games_Chess::factory()
Games_Chess::gameOver()
Games_Chess::getDiagonalColor()
Games_Chess::getMessage()
Get an error message from the code
Games_Chess::getMoveList()
Get the list of moves in Standard Algebraic Notation
Games_Chess::getPieceLocations()
Get the location of all pieces on the board of a certain color
Games_Chess::getPossibleBishopMoves()
Get all legal Bishop moves (checking of the king is not taken into account)
Games_Chess::getPossibleKingMoves()
Get all legal King moves (checking of the king is not taken into account)
Games_Chess::getPossibleKnightMoves()
Get all legal Knight moves (checking of the king is not taken into account)
Games_Chess::getPossibleMoves()
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.
Games_Chess::getPossiblePawnMoves()
Get all legal Pawn moves (checking of the king is not taken into account)
Games_Chess::getPossibleQueenMoves()
Get all legal Queen moves (checking of the king is not taken into account)
Games_Chess::getPossibleRookMoves()
Get all legal Rook moves (checking of the king is not taken into account)
Games_Chess::getState()
Get the current state of the chess game
Games_Chess::in50MoveDraw()
Determine whether any pawn move or capture has occurred in the past 50 moves
Games_Chess::inBasicDraw()
Determine the presence of a basic draw as defined by FIDE rules
Games_Chess::inCheckMate()
Determine whether a side is in checkmate
Games_Chess::inDraw()
Determines the presence of a forced draw
Games_Chess::inRepetitionDraw()
Determine whether draw by repetition has happened
Games_Chess::inStaleMate()
Determine whether a side is in stalemate
Games_Chess::isError()
Determines whether the data returned from a method is a PEAR-related
Games_Chess::isPromoteMove()
Determine whether moving a piece from one square to another requires
Games_Chess::moveSAN()
Make a move from a Standard Algebraic Notation (SAN) format
Games_Chess::moveSquare()
Move a piece from one square to another, and mark the old square as empty
Games_Chess::raiseError()
Games_Chess::renderFen()
render the FEN notation for the current board
Games_Chess::resetGame()
Create a new game with the starting position, or from the position specified by $fen
Games_Chess::rollbackTransaction()
Undo any changes to state since startTransaction() was first used
Games_Chess::setState()
Set the state of the chess game
Games_Chess::startTransaction()
Begin a chess piece transaction
Games_Chess::toArray()
Generate a representation of the chess board and pieces for use as a direct translation to a visual chess board
Games_Chess::toMove()
Games_Chess::_convertSquareToSAN()
Convert a starting and ending algebraic square into SAN
Games_Chess::_getAllPieceLocations()
Get the location of every piece on the board of color $color
Games_Chess::_getCastleSquares()
Get a list of all the squares a king could castle to on an empty board
Games_Chess::_getDiagonalColor()
Return the color of a square (black or white)
Games_Chess::_getKingSquares()
Get a list of all the squares a king could move to on an empty board
Games_Chess::_getKnightSquares()
Get all the squares a knight could move to on an empty board
Games_Chess::_getQueenSquares()
Get all the squares a queen could go to on a blank board
Games_Chess::_getRookSquares()
Get the set of squares that are diagonals from this square on an empty board.
Games_Chess::_moveAlgebraic()
Move a piece from one square to another, and mark the old square as empty
Games_Chess::_parseMove()
Parse out the segments of a move (minus any annotations)
Games_Chess::_setupStartingPosition()
Set up the board with the starting position
Games_Chess::_validMove()
Validate a move

Class Details

[line 40]
Losers chess game

The goal of the game is to lose all of your pieces or force your opponent to checkmate you. The only differences from standard chess are that if a capture is possible it must be executed, similar to checkers, and checkmate actually loses the game!



[ Top ]


Method Detail

gameOver   [line 108]

W|B|D gameOver( )

  • Return: winner of game, or draw

Overrides Games_Chess::gameOver() (parent method not documented)
[ Top ]

_capturePossible   [line 45]

void _capturePossible( )

Determine whether it is possible to capture an opponent's piece
  • Access: protected

[ Top ]

_validMove   [line 88]

true|PEAR_Error _validMove( array $move)

Validate a move
  • Throws: GAMES_CHESS_ERROR_MOVE_MUST_CAPTURE
  • Access: protected

Overrides Games_Chess::_validMove() (Validate a move)

Parameters:

array   $move   —  parsed move array from _parseMove()

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:05:02 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.