Class: PiecePosition

PiecePosition

represents a position on the board

Constructor

new PiecePosition()

Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:

Methods

equal(otherPos) → {boolean}

compare one position to another
This:
Parameters:
Name Type Description
otherPos PiecePosition the position to compare to
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this position to some other position.
Type
boolean

initialize(x, y) → {PiecePosition}

creates a new instance
This:
Parameters:
Name Type Description
x number x co-ordinate.
y number y co-ordinate.
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the new instance of this class. The method checks if the values given to it are in the 0..7 range.
Type
PiecePosition

notEqual(otherPos) → {boolean}

compare one position to another
This:
Parameters:
Name Type Description
otherPos PiecePosition the position to compare to
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
is this position to some other position.
Type
boolean

toString() → {string}

toString method so that you can get a nice printout of instances of this type
This:
Author:
  • mark.veltzer@gmail.com (Mark Veltzer)
Source:
Returns:
the string representation of this instance.
Type
string