File: Games\Plateau\Game.js

GamesByEmail
Class PlateauPiece

Object
  
 
 
GamesByEmail.Piece
 
 
GamesByEmail.PlateauPiece

All Implemented Interfaces:

Class


GamesByEmail.PlateauPiece

extends Piece

Constructor Summary
GamesByEmail.PlateauPiece(/*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
StringBuilderappendHtml(/*StringBuilder*/ htmlBuilder)
Adds the pieces HTML to the a string builder. #returns The string builder after appending.
 canMoveBottom(color)
 captureAtIndex(index)
voidcenter(/*Point*/ screenPoint, /*Boolean*/ noConstrain)
Centers the piece on a point.
 centerStackToScreenPoint(screenPoint, stack, noConstrain)
 closestMovableIndexToIndex(index, color)
 couldCaptures(numCouldCapture, color)
 countColor(color)
 debug()
 dispose()
 findContinuousColorStack(color, targetNum)
 flipAtIndex(index, reveal)
 getBoardValueIndexAtIndex(index)
 getClipRectAtIndex(index)
 getColorAtIndex(index)
 getInsertionIndices(insertionColor)
 getMoveStackIndexFromScreenPointAndColor(screenPoint, color)
 getNumInStack()
 getPeruseIndices(color)
 getPeruseOffset(index, small)
 getPrivateValueAtIndex(index)
 getPublicValueAtIndex(index)
 getStackElement(index)
 getStackMovementType()
 getSubpieceHtml(index, screenRect, clipRect, hidden, zIndex)
 getTeamAtIndex(index)
 getTeamValueIndexAtIndex(index)
 getTopStackSize(color)
 getZIndexBase()
 getZIndexBaseForBoardPoint(boardPoint)
 getZIndexBaseForValueIndex(valueIndex)
 hasBounceWeaponOnTop(color)
 insertBoardValueAtIndex(boardValue, index, noReset)
 isColorAtTop(color)
 isEntireStackThisColor(color)
 isWeaponAtIndex(index)
 maybeCapture(numToCapture)
 maybeFlipAtScreenPoint(color, screenPoint, reveal)
 maybeFlipTop(color, reveal)
 peruseAtIndex(index, multiplier, small)
 peruseAtScreenPoint(screenPoint, color)
 peruseReset()
voidreset(/*String*/ boardValueOverride, /*String*/ visibilityOverride)
Resets a piece to its boardPoint position and hidden state after a call to snap, center or setVisibility.
 revealTopAtIndex(index, noUpdate)
 revealTopAtTop(noUpdate)
voidsetBoardValue(/*String*/ boardValue, /*Boolean*/ noReset)
Changes the piece's board value (the color and type of piece it is).
 setExtendedVisibility(hidden)
voidsetVisibility(/*Boolean*/ hidden)
Sets the 'temporary' visibility of a piece.
 setVisibilityAtIndex(hidden, index)
 setVisibilityAtRange(hidden, low, high)
voidsnap(/*Point*/ boardPoint, /*String*/ boardValueOverride)
Centers the piece on a board point. The boardPoint property is not altered.
 snapDoInsert(insertIndex, screenRect, num, zBase)
 snapInsert(insertIndex, piece, num)
 snapStackToBoardPoint(boardPoint, stack)
 stackIndexFromScreenPointAndColor(screenPoint, color)
 stackIndexFromScreenPointAndIndices(screenPoint, indices)
 stackIndexFromScreenPointAndInsertionColor(screenPoint, insertionColor)
 topIsMoving(num)
 updateAtIndex(index)

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

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

PlateauPiece

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

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.

canMoveBottom

canMoveBottom(color)
Parameters:
color - 


captureAtIndex

captureAtIndex(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.

centerStackToScreenPoint

centerStackToScreenPoint(screenPoint,
                         stack,
                         noConstrain)
Parameters:
screenPoint - 

stack - 

noConstrain - 


closestMovableIndexToIndex

closestMovableIndexToIndex(index,
                           color)
Parameters:
index - 

color - 


couldCaptures

couldCaptures(numCouldCapture,
              color)
Parameters:
numCouldCapture - 

color - 


countColor

countColor(color)
Parameters:
color - 


debug

debug()

dispose

dispose()
Overrides:
dispose in class Piece

findContinuousColorStack

findContinuousColorStack(color,
                         targetNum)
Parameters:
color - 

targetNum - 


flipAtIndex

flipAtIndex(index,
            reveal)
Parameters:
index - 

reveal - 


getBoardValueIndexAtIndex

getBoardValueIndexAtIndex(index)
Parameters:
index - 


getClipRectAtIndex

getClipRectAtIndex(index)
Parameters:
index - 


getColorAtIndex

getColorAtIndex(index)
Parameters:
index - 


getInsertionIndices

getInsertionIndices(insertionColor)
Parameters:
insertionColor - 


getMoveStackIndexFromScreenPointAndColor

getMoveStackIndexFromScreenPointAndColor(screenPoint,
                                         color)
Parameters:
screenPoint - 

color - 


getNumInStack

getNumInStack()

getPeruseIndices

getPeruseIndices(color)
Parameters:
color - 


getPeruseOffset

getPeruseOffset(index,
                small)
Parameters:
index - 

small - 


getPrivateValueAtIndex

getPrivateValueAtIndex(index)
Parameters:
index - 


getPublicValueAtIndex

getPublicValueAtIndex(index)
Parameters:
index - 


getStackElement

getStackElement(index)
Parameters:
index - 


getStackMovementType

getStackMovementType()

getSubpieceHtml

getSubpieceHtml(index,
                screenRect,
                clipRect,
                hidden,
                zIndex)
Parameters:
index - 

screenRect - 

clipRect - 

hidden - 

zIndex - 


getTeamAtIndex

getTeamAtIndex(index)
Parameters:
index - 


getTeamValueIndexAtIndex

getTeamValueIndexAtIndex(index)
Parameters:
index - 


getTopStackSize

getTopStackSize(color)
Parameters:
color - 


getZIndexBase

getZIndexBase()

getZIndexBaseForBoardPoint

getZIndexBaseForBoardPoint(boardPoint)
Parameters:
boardPoint - 


getZIndexBaseForValueIndex

getZIndexBaseForValueIndex(valueIndex)
Parameters:
valueIndex - 


hasBounceWeaponOnTop

hasBounceWeaponOnTop(color)
Parameters:
color - 


insertBoardValueAtIndex

insertBoardValueAtIndex(boardValue,
                        index,
                        noReset)
Parameters:
boardValue - 

index - 

noReset - 


isColorAtTop

isColorAtTop(color)
Parameters:
color - 


isEntireStackThisColor

isEntireStackThisColor(color)
Parameters:
color - 


isWeaponAtIndex

isWeaponAtIndex(index)
Parameters:
index - 


maybeCapture

maybeCapture(numToCapture)
Parameters:
numToCapture - 


maybeFlipAtScreenPoint

maybeFlipAtScreenPoint(color,
                       screenPoint,
                       reveal)
Parameters:
color - 

screenPoint - 

reveal - 


maybeFlipTop

maybeFlipTop(color,
             reveal)
Parameters:
color - 

reveal - 


peruseAtIndex

peruseAtIndex(index,
              multiplier,
              small)
Parameters:
index - 

multiplier - 

small - 


peruseAtScreenPoint

peruseAtScreenPoint(screenPoint,
                    color)
Parameters:
screenPoint - 

color - 


peruseReset

peruseReset()

reset

void reset(/*String*/ boardValueOverride,
           /*String*/ visibilityOverride)

Resets a piece to its boardPoint position and hidden state after a call to snap, center or setVisibility.

Overrides:
reset in class Piece
Parameters:
boardValueOverride - 
(Optional) If provided, renders the piece with this value instead of its internal value property.
visibilityOverride - 
(Optional) If provided, renders the piece with this visibility instead of its internal hidden property.

revealTopAtIndex

revealTopAtIndex(index,
                 noUpdate)
Parameters:
index - 

noUpdate - 


revealTopAtTop

revealTopAtTop(noUpdate)
Parameters:
noUpdate - 


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.

setExtendedVisibility

setExtendedVisibility(hidden)
Parameters:
hidden - 


setVisibility

void setVisibility(/*Boolean*/ hidden)

Sets the 'temporary' visibility of a piece.

Overrides:
setVisibility in class Piece
Parameters:
hidden - 
Hides the piece.

setVisibilityAtIndex

setVisibilityAtIndex(hidden,
                     index)
Parameters:
hidden - 

index - 


setVisibilityAtRange

setVisibilityAtRange(hidden,
                     low,
                     high)
Parameters:
hidden - 

low - 

high - 


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.

snapDoInsert

snapDoInsert(insertIndex,
             screenRect,
             num,
             zBase)
Parameters:
insertIndex - 

screenRect - 

num - 

zBase - 


snapInsert

snapInsert(insertIndex,
           piece,
           num)
Parameters:
insertIndex - 

piece - 

num - 


snapStackToBoardPoint

snapStackToBoardPoint(boardPoint,
                      stack)
Parameters:
boardPoint - 

stack - 


stackIndexFromScreenPointAndColor

stackIndexFromScreenPointAndColor(screenPoint,
                                  color)
Parameters:
screenPoint - 

color - 


stackIndexFromScreenPointAndIndices

stackIndexFromScreenPointAndIndices(screenPoint,
                                    indices)
Parameters:
screenPoint - 

indices - 


stackIndexFromScreenPointAndInsertionColor

stackIndexFromScreenPointAndInsertionColor(screenPoint,
                                           insertionColor)
Parameters:
screenPoint - 

insertionColor - 


topIsMoving

topIsMoving(num)
Parameters:
num - 


updateAtIndex

updateAtIndex(index)
Parameters:
index -