API Docs for:
Show:

Queen Class

Module: Pieces

A Queen class, represents a Knight piece

Constructor

Queen

(
  • color
  • type
  • X
  • Y
  • id
)

Parameters:

  • color Object

    queen's color

  • type Object

    type of the piece, e.g. "Queen"

  • X Object

    x coordinate on the board (0-7), 0 represents 'a' file, 7 represents 'h' file

  • Y Object

    y coordinate on the board (0-7), 0 represents 8-th rank, 7 represnts 1-st rank

  • id Object

    id of the piece

Methods

getCoveredFields

() Array

get piece covered fields

Returns:

Array:

an array of (x,y) coordinates represents a set of fields, covered by a piece

getImageSource

() String

get relative path to the piece image

Returns:

String:

path to the piece image

getLegalMoves

() Array

get piece legal moves

Returns:

Array:

an array of (x,y) coordinates represents a legal moves for a piece

getNotationSymbol

() String

get notation symbol of the piece

Returns:

String:

notation symbol

move

(
  • x
  • y
)
Object

moves piece to a new field

Parameters:

  • x Number

    x coordinate of destination

  • y Number

    y coordinate of destination

Returns:

Object:

object represents a summary of the move

Properties

color

String

Queen's color

ID

Number

Queen's ID

notationName

String

notation symbol

type

String

Queen's type

X

Number

x coordinate

Y

Number

y coordinate