Games\Plateau\Game.js
GamesByEmail
Object
GamesByEmail.Piece
All Implemented Interfaces:
GamesByEmail.PlateauPiece
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.
|
|
|
|
|
|
Centers the piece on a point.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Resets a piece to its
boardPoint position and hidden state after a call to snap , center or setVisibility . |
|
|
|
|
|
Changes the piece's board value (the color and type of piece it is).
|
|
|
|
Sets the 'temporary' visibility of a piece.
|
|
|
|
|
|
Centers the piece on a board point. The
boardPoint property is not altered. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
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 |
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.
canMoveBottom(color)
color -
captureAtIndex(index)
index -
void
center(/*Point
*/ screenPoint,
/*Boolean
*/ noConstrain)
Centers the piece on a point.
Overrides: Parameters:screenPoint -The screen point on which to center.
noConstrain -(Optional) Override the game's
GamesByEmail.Game.constrainer
rectangle.
centerStackToScreenPoint(screenPoint,
stack,
noConstrain)
screenPoint -
stack -
noConstrain -
closestMovableIndexToIndex(index,
color)
index -
color -
couldCaptures(numCouldCapture,
color)
numCouldCapture -
color -
countColor(color)
color -
debug()
dispose()
findContinuousColorStack(color,
targetNum)
color -
targetNum -
flipAtIndex(index,
reveal)
index -
reveal -
getBoardValueIndexAtIndex(index)
index -
getClipRectAtIndex(index)
index -
getColorAtIndex(index)
index -
getInsertionIndices(insertionColor)
insertionColor -
getMoveStackIndexFromScreenPointAndColor(screenPoint,
color)
screenPoint -
color -
getNumInStack()
getPeruseIndices(color)
color -
getPeruseOffset(index,
small)
index -
small -
getPrivateValueAtIndex(index)
index -
getPublicValueAtIndex(index)
index -
getStackElement(index)
index -
getStackMovementType()
getSubpieceHtml(index,
screenRect,
clipRect,
hidden,
zIndex)
index -
screenRect -
clipRect -
hidden -
zIndex -
getTeamAtIndex(index)
index -
getTeamValueIndexAtIndex(index)
index -
getTopStackSize(color)
color -
getZIndexBase()
getZIndexBaseForBoardPoint(boardPoint)
boardPoint -
getZIndexBaseForValueIndex(valueIndex)
valueIndex -
hasBounceWeaponOnTop(color)
color -
insertBoardValueAtIndex(boardValue,
index,
noReset)
boardValue -
index -
noReset -
isColorAtTop(color)
color -
isEntireStackThisColor(color)
color -
isWeaponAtIndex(index)
index -
maybeCapture(numToCapture)
numToCapture -
maybeFlipAtScreenPoint(color,
screenPoint,
reveal)
color -
screenPoint -
reveal -
maybeFlipTop(color,
reveal)
color -
reveal -
peruseAtIndex(index,
multiplier,
small)
index -
multiplier -
small -
peruseAtScreenPoint(screenPoint,
color)
screenPoint -
color -
peruseReset()
void
reset(/*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)
index -
noUpdate -
revealTopAtTop(noUpdate)
noUpdate -
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.
setExtendedVisibility(hidden)
hidden -
void
setVisibility(/*Boolean
*/ hidden)
Sets the 'temporary' visibility of a piece.
Overrides:setVisibility
in class Piece
hidden -Hides the piece.
setVisibilityAtIndex(hidden,
index)
hidden -
index -
setVisibilityAtRange(hidden,
low,
high)
hidden -
low -
high -
void
snap(/*Point
*/ boardPoint,
/*String
*/ boardValueOverride)
Centers the piece on a board point. The boardPoint
property is not altered.
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(insertIndex,
screenRect,
num,
zBase)
insertIndex -
screenRect -
num -
zBase -
snapInsert(insertIndex,
piece,
num)
insertIndex -
piece -
num -
snapStackToBoardPoint(boardPoint,
stack)
boardPoint -
stack -
stackIndexFromScreenPointAndColor(screenPoint,
color)
screenPoint -
color -
stackIndexFromScreenPointAndIndices(screenPoint,
indices)
screenPoint -
indices -
stackIndexFromScreenPointAndInsertionColor(screenPoint,
insertionColor)
screenPoint -
insertionColor -
topIsMoving(num)
num -
updateAtIndex(index)
index -