Games\Twixt\Game.js
GamesByEmail
Object
GamesByEmail.Piece
All Implemented Interfaces:
GamesByEmail.TwixtPiece
extendsPiece
Constructor Summary |
Creates a piece.
|
Field Summary |
Fields inherited from GamesByEmail.Piece |
boardPoint , hidden , index , pieces , valueIndex |
Method Summary | |
|
Adds the pieces HTML to the a string builder.
#returns The string builder after appending.
|
|
|
|
Gets the clipping rectangle for this piece based on its color value.
#returns The clipping rectangle.
|
|
|
|
|
|
Changes the piece's board value (the color and type of piece it is).
|
Methods inherited from GamesByEmail.Piece |
center , create , elementId , event , getBoardValue , getElement , getImageSrc , getScreenRect , isColor , isOurs , move , occupiesBoardPoint , remove , reset , setColor , setHidden , setValue , setValueAndColor , setVisibility , snap |
Methods inherited from Foundation.Class |
getTypePath , isInstanceOf |
Constructor Detail |
GamesByEmail.TwixtPiece(/*Pieces
*/ pieces,
/*Number
*/ index,
/*Number
*/ value,
/*Number
*/ valueIndex,
/*Boolean
*/ hidden)
Creates a piece.
Parameters:pieces -The parent pieces object.
index -The position of this piece in the parent pieces object.
value -The value of this piece.
valueIndex -The position of this piece's value in the result of the pieces getValue call. Set to -1 to not include in getValue.
hidden -Whether the piece is visible to the current player or not.
Method Detail |
StringBuilder
appendHtml(/*StringBuilder
*/ htmlBuilder)
Adds the pieces HTML to the a string builder. #returns The string builder after appending.
Overrides:appendHtml
in class Piece
htmlBuilder -The string builder to append to.
dispose()
Rectangle
getClipRect()
Gets the clipping rectangle for this piece based on its color value. #returns The clipping rectangle.
Overrides:getClipRect
in class Piece
getGateClipRect(direction)
direction -
getGateScreenRect(x,
y,
screenRect)
x -
y -
screenRect -
void
setBoardValue(/*String
*/ boardValue,
/*Boolean
*/ noReset)
Changes the piece's board value (the color and type of piece it is).
Overrides:setBoardValue
in class Piece
boardValue -The new board value of the piece.
noReset -(Optional) If true, the piece is not redrawn.