File: Games\Byte\Game.js

GamesByEmail
Class BytePiece

Object
  
 
 
GamesByEmail.Piece
 
 
GamesByEmail.BytePiece

All Implemented Interfaces:

Class


GamesByEmail.BytePiece

extends Piece

Constructor Summary
GamesByEmail.BytePiece(/*Pieces*/ pieces, /*Number*/ index, /*Number*/ value, /*Number*/ valueIndex, /*Boolean*/ hidden)
Creates a piece.

Field Summary

Fields inherited from GamesByEmail.Piece
boardPoint, hidden, index, pieces, valueIndex

Method Summary
 abortCaptureAnimation()
 addToStack(stack, animationPoint)
StringBuilderappendHtml(/*StringBuilder*/ htmlBuilder)
Adds the pieces HTML to the a string builder. #returns The string builder after appending.
 breakStackAtIndex(index)
voidcenter(/*Point*/ screenPoint, /*Boolean*/ noConstrain)
Centers the piece on a point.
 dispose()
RectanglegetClipRect()
Gets the clipping rectangle for this piece based on its color value. #returns The clipping rectangle.
voidsetBoardValue(/*String*/ boardValue, /*Boolean*/ noReset)
Changes the piece's board value (the color and type of piece it is).
voidsnap(/*Point*/ boardPoint, /*String*/ boardValueOverride)
Centers the piece on a board point. The boardPoint property is not altered.
 startCaptureAnimation(point, stack, moveSpeed)
 stepCaptureAnimation()

Methods inherited from GamesByEmail.Piece
create, elementId, event, getBoardValue, getElement, getImageSrc, getScreenRect, isColor, isOurs, move, occupiesBoardPoint, remove, reset, setColor, setHidden, setValue, setValueAndColor, setVisibility

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

BytePiece

GamesByEmail.BytePiece(/*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

abortCaptureAnimation

abortCaptureAnimation()

addToStack

addToStack(stack,
           animationPoint)
Parameters:
stack - 

animationPoint - 


appendHtml

StringBuilder appendHtml(/*StringBuilder*/ htmlBuilder)

Adds the pieces HTML to the a string builder. #returns The string builder after appending.

Overrides:
appendHtml in class Piece
Parameters:
htmlBuilder - 
The string builder to append to.

breakStackAtIndex

breakStackAtIndex(index)
Parameters:
index - 


center

void center(/*Point*/ screenPoint,
            /*Boolean*/ noConstrain)

Centers the piece on a point.

Overrides:
center in class Piece
Parameters:
screenPoint - 
The screen point on which to center.
noConstrain - 
(Optional) Override the game's GamesByEmail.Game.constrainer rectangle.

dispose

dispose()
Overrides:
dispose in class Piece

getClipRect

Rectangle getClipRect()

Gets the clipping rectangle for this piece based on its color value. #returns The clipping rectangle.

Overrides:
getClipRect in class Piece

setBoardValue

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
Parameters:
boardValue - 
The new board value of the piece.
noReset - 
(Optional) If true, the piece is not redrawn.

snap

void snap(/*Point*/ boardPoint,
          /*String*/ boardValueOverride)

Centers the piece on a board point. The boardPoint property is not altered.

Overrides:
snap in class Piece
Parameters:
boardPoint - 
The board point on which to center.
boardValueOverride - 
(Optional) If provided, renders the piece with this value instead of its internal value property.

startCaptureAnimation

startCaptureAnimation(point,
                      stack,
                      moveSpeed)
Parameters:
point - 

stack - 

moveSpeed - 


stepCaptureAnimation

stepCaptureAnimation()