Games\GamesByEmail.jsGamesByEmailArray
All Implemented Interfaces:
GamesByEmail.Pieces
extendsArray
implementsFoundation.Class
A collection of pieces in a game, like chess. May be used directly or extended. Implemented as an Array.
See Also:
| Constructor Summary |
Creates a piece collection.
|
| Field Summary | |
| game
The parent game object.
|
Fields inherited from Array |
length |
| Method Summary | |
|
Adds the necessary HTML to display highlights for the pieces collection. To be overridden by each game class as necessary.
|
|
Adds the necessary HTML to display the pieces collection, wrapped in a container element for positioning.
|
|
Adds the necessary HTML to display the pieces collection.
|
|
Cancels all flashing pieces.
|
|
Removes all pieces from the collection.
|
|
Gets the number of pieces of a color.
|
|
|
|
Finds the piece in the collection located at a board point.
|
|
Flashes one or more pieces a specified number of times, then invokes code.
|
|
Gets the extra piece object in the collection for adding new pieces to the board in games like Reversi and Go.
|
|
Gets the combined value of all the pieces in the collection, extra piece object in the collection for adding new pieces to the board in games like Reversi and Go.
|
|
Sets the value for the entire pieces collection. The collection is cleared, and new pieces are added for non-blank characters. An extra piece is always added, see
getNewPiece. |
Methods inherited from Array |
indexOf |
Methods inherited from Foundation.Class |
getTypePath, isInstanceOf |
| Constructor Detail |
GamesByEmail.Pieces(/*Game*/ game)
Creates a piece collection.
Parameters:game -The parent game object.
| Field Detail |
Game game
The parent game object.
| Method Detail |
StringBuilder appendHiliteHtml(/*StringBuilder*/ htmlBuilder)
Adds the necessary HTML to display highlights for the pieces collection. To be overridden by each game class as necessary.
Parameters:htmlBuilder -The HTML builder to append to.
StringBuilder appendHtml(/*StringBuilder*/ htmlBuilder,
/*Point*/ boardSize)
Adds the necessary HTML to display the pieces collection, wrapped in a container element for positioning.
Parameters:htmlBuilder -The HTML builder to append to.
boardSize -The size of the board on which the pieces will be overlayed.
StringBuilder appendInnerHtml(/*StringBuilder*/ htmlBuilder)
Adds the necessary HTML to display the pieces collection.
Parameters:htmlBuilder -The HTML builder to append to.
void cancelFlashes()
Cancels all flashing pieces.
void clear()
Removes all pieces from the collection.
Number countColor(/*Number*/ color)
Gets the number of pieces of a color.
Parameters:color -The color to look for.
dispose()
dispose in class Class
Piece findAtPoint(/*Point*/ boardPoint)
Finds the piece in the collection located at a board point.
Parameters:boardPoint -The board point to search.
null.
void flash(/*Number*/ numFlashes,
/*String*/ doneCode,
/*Point|Array*/ boardPoint,
...)
Flashes one or more pieces a specified number of times, then invokes code.
Parameters:numFlashes -The number of times to flash the pieces on and off.
doneCode -The code to execute when the flashing is complete. Generally created with the game.
event method.boardPoint -(Repeatable) The board point(s) and/or arrays of board points of the piece to flash.
Piece getNewPiece()
Gets the extra piece object in the collection for adding new pieces to the board in games like Reversi and Go.
Returns:
String getValue()
Gets the combined value of all the pieces in the collection, extra piece object in the collection for adding new pieces to the board in games like Reversi and Go.
Returns:
void setValue(/*String*/ value)
Sets the value for the entire pieces collection. The collection is cleared, and new pieces are added for non-blank characters. An extra piece is always added, see getNewPiece.
value -The value, usually from game.info.board.