ChessBrowser
Extension to create interactive chess boards
Loading...
Searching...
No Matches
MediaWiki\Extension\ChessBrowser\ChessPiece Class Reference

Public Member Functions

 __construct (string $symbol)
 
 getSymbol ()
 Get the symbol for the piece.
 
 getType ()
 Get the type.
 
 getColor ()
 Get the color.
 
 getAsHex ()
 Get the hex representation of the piece.
 
 getMovePatterns ()
 Get the possible moves.
 
 getNotation ()
 Get the symbol to use for notation.
 

Static Public Member Functions

static newFromHex (int $hex)
 Create from the hex representation, for use in FenParser0x88.
 

Public Attributes

const COLOR_WHITE = 'white'
 
const COLOR_BLACK = 'black'
 
const WHITE_PAWN = 0x01
 
const WHITE_KNIGHT = 0x02
 
const WHITE_KING = 0x03
 
const WHITE_BISHOP = 0x05
 
const WHITE_ROOK = 0x06
 
const WHITE_QUEEN = 0x07
 
const BLACK_PAWN = 0x09
 
const BLACK_KNIGHT = 0x0A
 
const BLACK_KING = 0x0B
 
const BLACK_BISHOP = 0x0D
 
const BLACK_ROOK = 0x0E
 
const BLACK_QUEEN = 0x0F
 

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Extension\ChessBrowser\ChessPiece::__construct ( string $symbol)
Parameters
string$symbol
Exceptions
ChessBrowserException

Member Function Documentation

◆ getAsHex()

MediaWiki\Extension\ChessBrowser\ChessPiece::getAsHex ( )

Get the hex representation of the piece.

Returns
int

◆ getColor()

MediaWiki\Extension\ChessBrowser\ChessPiece::getColor ( )

Get the color.

Returns
string

◆ getMovePatterns()

MediaWiki\Extension\ChessBrowser\ChessPiece::getMovePatterns ( )

Get the possible moves.

Returns
array

◆ getNotation()

MediaWiki\Extension\ChessBrowser\ChessPiece::getNotation ( )

Get the symbol to use for notation.

Returns
string

◆ getSymbol()

MediaWiki\Extension\ChessBrowser\ChessPiece::getSymbol ( )

Get the symbol for the piece.

Returns
string

◆ getType()

MediaWiki\Extension\ChessBrowser\ChessPiece::getType ( )

Get the type.

Returns
string

◆ newFromHex()

static MediaWiki\Extension\ChessBrowser\ChessPiece::newFromHex ( int $hex)
static

Create from the hex representation, for use in FenParser0x88.

Parameters
int$hex
Returns
ChessPiece
Exceptions
ChessBrowserException

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