Methods
getData() → {anything}
Method to get secret data for this piece
This:
- Source:
Returns:
the secret data associated with this piece.
- Type
- anything
initialize(color, type) → {BoardPiece}
constructs a new object.
This:
Parameters:
Name | Type | Description |
---|---|---|
color |
string | color of this piece (black/white). |
type |
string | type of this piece (rook/knight/bishop/queen/king/pawn). |
- Source:
Returns:
the new object created.
- Type
- BoardPiece
setData(data)
Method to set secret data for this piece
This:
Parameters:
Name | Type | Description |
---|---|---|
data |
anything | the extra data to hold for this piece. |
- Source:
toString() → {string}
toString method that allows you to get a nice printout for this type
This:
- Source:
Returns:
string representation of this object.
- Type
- string
unsetData()
Method to unset secret data for this piece
This:
- Source: