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

Public Member Functions

 getAsVertical64 ()
 Get the 0-63 representation going up files A1=0; B1=1; etc.
 
 getCoords ()
 Get the coordinates.
 
 getNumber ()
 Get the 0x88 location.
 
 getRank ()
 Get the rank number.
 
 getFile ()
 Get the file letter.
 

Static Public Member Functions

static newFromNumber (int $number)
 
static newFromLateral64 (int $number)
 For conversion from a 0-63 representation which counted across rows.
 
static newFromCoords (string $coords)
 

Public Attributes

const NUMBER_TO_FILE
 
const FILE_TO_NUMBER
 

Member Function Documentation

◆ getAsVertical64()

MediaWiki\Extension\ChessBrowser\ChessSquare::getAsVertical64 ( )

Get the 0-63 representation going up files A1=0; B1=1; etc.

Returns
int

◆ getCoords()

MediaWiki\Extension\ChessBrowser\ChessSquare::getCoords ( )

Get the coordinates.

Returns
string

◆ getFile()

MediaWiki\Extension\ChessBrowser\ChessSquare::getFile ( )

Get the file letter.

Returns
string

◆ getNumber()

MediaWiki\Extension\ChessBrowser\ChessSquare::getNumber ( )

Get the 0x88 location.

Returns
int

◆ getRank()

MediaWiki\Extension\ChessBrowser\ChessSquare::getRank ( )

Get the rank number.

Returns
int

◆ newFromCoords()

static MediaWiki\Extension\ChessBrowser\ChessSquare::newFromCoords ( string $coords)
static
Parameters
string$coords
Returns
ChessSquare
Exceptions
ChessBrowserExceptionif invalid

◆ newFromLateral64()

static MediaWiki\Extension\ChessBrowser\ChessSquare::newFromLateral64 ( int $number)
static

For conversion from a 0-63 representation which counted across rows.

Parameters
int$number
Returns
ChessSquare

◆ newFromNumber()

static MediaWiki\Extension\ChessBrowser\ChessSquare::newFromNumber ( int $number)
static
Parameters
int$number
Returns
ChessSquare

Member Data Documentation

◆ FILE_TO_NUMBER

const MediaWiki\Extension\ChessBrowser\ChessSquare::FILE_TO_NUMBER
Initial value:
= [
'a' => 0,
'b' => 1,
'c' => 2,
'd' => 3,
'e' => 4,
'f' => 5,
'g' => 6,
'h' => 7
]

◆ NUMBER_TO_FILE

const MediaWiki\Extension\ChessBrowser\ChessSquare::NUMBER_TO_FILE
Initial value:
= [
0 => 'a',
1 => 'b',
2 => 'c',
3 => 'd',
4 => 'e',
5 => 'f',
6 => 'g',
7 => 'h'
]

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