Games\Plateau\Game.jsGamesByEmailObject
GamesByEmail.Game
All Implemented Interfaces:
GamesByEmail.PlateauGame
extendsGame
| Constructor Summary |
|
| Field Summary | |
| animationNumSteps
|
| animationStartInterval
|
| animationStepInterval
|
static | resourcePack
Resources for most of the game. Override to add resources specific to game.
|
Fields inherited from GamesByEmail.Game |
board, canPie, constrainer, font, id, info, isLog, lastMove, logSettings, maxMoveNumber, message, move, notify, onLeftMouseDown, onLeftMouseUp, onMiddleMouseDown, onMiddleMouseUp, onMouseDown, onMouseMove, onMouseOut, onMouseOver, onMouseUp, onRightMouseDown, onRightMouseUp, pieces, previewing, rotation, status, teams, territories, testing, title, type, verbose |
Fields inherited from Foundation.Elemental |
$Foundation_$registry_index |
| Method Summary | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called when needing the complete-your-turn game prompt HTML (typically a short sentence about the move and a Send This Move button). Override and set mouse events here. Internally uses the "completeYourTurn" resource.
|
|
Called when needing the continue-your-turn game prompt HTML (typically a short sentence about the move, no send move button yet). Override and set mouse events here. Internally uses the "continueYourTurn" resource.
|
|
|
|
|
|
|
|
|
|
Called when needing the game-over game prompts HTML. Override to set. Internally returns one of the following:
theyResignedHtml, youResignedHtml, youTiedHtml, drawAcceptedHtml, youWinHtml or youLoseHtml. |
|
|
|
|
|
|
|
|
|
Called when needing the game prompts HTML. Override to set. Internally clears the mouse events, then returns either
spectatingHtml, gameOverHtml, notYourTurnHtml or getTurnHtml. |
|
Gets the HTML of the entire game.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gets the HTML for the team title on the board. By default uses resources 'turnTeamTitle' or 'teamTitle'.
|
|
|
|
|
|
|
|
|
|
The first method to be called when a game is created, override to set up teams, players and the game state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called when needing the it-is-your-turn game prompt HTML (typically a short sentence about the move). Override and set mouse events here. Internally uses the "itIsYourTurnToMove" resource.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Called when needing the it-is-not-your-turn game prompt HTML (typically a short sentence with Send Reminder, Refresh Game and Close Window buttons Start Another Game button). Override to set. Internally uses the "notYourTurn" resource.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gets called when the sending moves, fir processing secure move data on the client. Override to process secure data.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gets called when the Send Move button is pushed. Override and set the game state, then call Super.sendMove.
|
|
|
|
|
|
Called when synchronizing, sets the perspective of the board based on the player. By default sets the
rotation property to 0. |
|
|
|
|
|
|
|
Called when the game should synchronize with
info properties from the server. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Methods inherited from Foundation.Class |
getTypePath, isInstanceOf |
Methods inherited from Foundation.Elemental |
attachEvent, detachEvent, elementId, event, getById, getElement, getElementValue, getElements, getFirst, getNext, parseElementId, processHtml, processHtml |
Methods inherited from Foundation.Resourceful |
resource, resource, resourceUrl, resourceUrl |
Methods inherited from Foundation.Server |
server, serverSerialized, serverSynchronous |
| Constructor Detail |
GamesByEmail.PlateauGame()
| Field Detail |
animationNumSteps
animationStartInterval
animationStepInterval
static Object resourcePack
Resources for most of the game. Override to add resources specific to game.
Overrides:resourcePack in class Game| Method Detail |
addToCaptured(team,
value,
toEnd)
team -
value -
toEnd -
addToReserve(team,
value,
toEnd)
team -
value -
toEnd -
addToTrades(team,
value)
team -
value -
animateCapture(captured,
boardPoint)
captured -
boardPoint -
animationAbort()
animationAppendImages()
animationPushCaptures(captured,
boardPoint)
captured -
boardPoint -
animationRemoveImages()
animationSetCapturedVisibility(hidden)
hidden -
animationSetCapturedVisibilityAtIndex(hidden,
index)
hidden -
index -
animationStartNext()
animationStep()
canMove(team)
team -
canOnboardAtBoardPoint(boardPoint)
boardPoint -
checkForWin()
clearMovementAtPoint(boardPoint)
boardPoint -
String completeYourTurnHtml(/*String*/ resourceName)
Called when needing the complete-your-turn game prompt HTML (typically a short sentence about the move and a Send This Move button). Override and set mouse events here. Internally uses the "completeYourTurn" resource.
Overrides:completeYourTurnHtml in class GameresourceName -(Optional) A resource name to override the default resource to use.
String continueYourTurnHtml(/*String*/ resourceName)
Called when needing the continue-your-turn game prompt HTML (typically a short sentence about the move, no send move button yet). Override and set mouse events here. Internally uses the "continueYourTurn" resource.
Overrides:continueYourTurnHtml in class GameresourceName -(Optional) A resource name to override the default resource to use.
countMoving(leftMoving)
leftMoving -
dispose()
flipAtBoardPoint(boardPoint)
boardPoint -
flipOnMouseDown(screenPoint)
screenPoint -
String gameOverHtml()
Called when needing the game-over game prompts HTML. Override to set. Internally returns one of the following: theyResignedHtml, youResignedHtml, youTiedHtml, drawAcceptedHtml, youWinHtml or youLoseHtml.
gameOverHtml in class Game
getCapturedAtIndex(team,
index)
team -
index -
getCapturedList(team)
team -
getCapturedValue(value)
value -
getFlippedValue(boardValue)
boardValue -
String getGamePromptsHtml()
Called when needing the game prompts HTML. Override to set. Internally clears the mouse events, then returns either spectatingHtml, gameOverHtml, notYourTurnHtml or getTurnHtml.
getGamePromptsHtml in class Game
String getHtml()
getIndexOfReserve(team,
value)
team -
value -
getMovementStack(boardPoint,
auxMoveData)
boardPoint -
auxMoveData -
getMovingNumIntermediate(screenPoint,
stack)
screenPoint -
stack -
getMovingNumTerminal(boardPoint,
stackLength)
boardPoint -
stackLength -
getNumCaptured(team)
team -
getNumReserve(team)
team -
getNumTrades(team)
team -
getPiecesTitleHtml(team)
team -
getProcessedValue(p)
p -
getPublicValue(value)
value -
getReserveAtIndex(team,
index)
team -
index -
getReserveList(team)
team -
String getTeamTitleHtml(/*Team*/ team,
/*Boolean*/ top)
Gets the HTML for the team title on the board. By default uses resources 'turnTeamTitle' or 'teamTitle'.
Overrides:getTeamTitleHtml in class Gameteam -The team to get the color for.
top -Whether this team's title will be displayed above the board or below.
getTradeAtIndex(team,
index)
team -
index -
getTradeList(team)
team -
getTradeValue(trades)
trades -
getTurnOptionsHtml(continuing)
continuing -
void initialize(/*Number*/ numPlayers,
/*Number*/ turnTeamIndex)
The first method to be called when a game is created, override to set up teams, players and the game state.
Overrides:initialize in class GamenumPlayers -The number of players from the game form.
turnTeamIndex -The index of the team to set the initial turn. Call the Super with -1 to set all teams turn.
Example:
// Override initialize
initialize:function(numPlayers,turnTeamIndex)
{
// Call the Super.initialize to add default teams.
Super.initialize(numPlayers,turnTeamIndex);
// Initialize the board state.
this.info["board"]="rnbqkbnrpppppppp PPPPPPPPRNBQKBNR";
var team=this.teams[0];
team.info["i_ep"]=-1;
team.info["b_cs"]=true;
team.info["b_cl"]=true;
team=this.teams[1];
team.info["i_ep"]=-1;
team.info["b_cs"]=true;
team.info["b_cl"]=true;
// Log the start of game.
this.move.log=this.logEntry(44);
}
initiateFlipping()
initiateMoving()
initiateOnboarding()
initiatePerusing(color)
color -
initiateTrading()
isBoardPointOnMovementPath(boardPoint)
boardPoint -
isBoardPointOnMovementPath_b(boardPoint)
boardPoint -
isBoardPointOnMovementPath_m(boardPoint)
boardPoint -
isBoardPointOnMovementPath_r(boardPoint)
boardPoint -
isBoardPointOnMovementPath_t(boardPoint)
boardPoint -
isBounceWeaponValue(value)
value -
isEnigmaValue(value)
value -
isFlippableValue(value)
value -
isInitialTurn()
isIntermediateSpace(boardPoint)
boardPoint -
isPerimeterPoint(boardPoint)
boardPoint -
isPerusePaused(boardPoint)
boardPoint -
isWeaponValue(value)
value -
String itsYourTurnHtml(/*String*/ resourceName)
Called when needing the it-is-your-turn game prompt HTML (typically a short sentence about the move). Override and set mouse events here. Internally uses the "itIsYourTurnToMove" resource.
Overrides:itsYourTurnHtml in class GameresourceName -(Optional) A resource name to override the default resource to use.
logIconFromName(name)
name -
logPieceImagesFromIndices(moveIndex,
indices)
moveIndex -
indices -
logPieceImagesFromValues(values)
values -
logPointNotation(x,
y)
x -
y -
moveMouseMoved(screenPoint,
force)
screenPoint -
force -
moveOnMouseDown(screenPoint)
screenPoint -
moveOnMouseMove(screenPoint)
screenPoint -
moveOnMouseUp(screenPoint)
screenPoint -
movingGetBounceLogData()
movingGetLogData()
String notYourTurnHtml(/*String*/ resourceName)
Called when needing the it-is-not-your-turn game prompt HTML (typically a short sentence with Send Reminder, Refresh Game and Close Window buttons Start Another Game button). Override to set. Internally uses the "notYourTurn" resource.
Overrides:notYourTurnHtml in class GameresourceName -(Optional) A resource name to override the default resource to use.
onboardFlip(screenPoint)
screenPoint -
onboardMouseDown(event,
index)
event -
index -
onboardMouseMove(screenPoint)
screenPoint -
onboardMouseUp(screenPoint)
screenPoint -
onboardValueAtBoardPoint(value,
boardPoint,
insertIndex,
noUpdate)
value -
boardPoint -
insertIndex -
noUpdate -
perusePause(boardPoint)
boardPoint -
perusingOnMouseMove(screenPoint)
screenPoint -
perusingOnMouseOut()
processLogMove0(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove1(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove2(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove3(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove4(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove5(moveIndex,
data,
info)
moveIndex -
data -
info -
processLogMove6(moveIndex,
data,
info)
moveIndex -
data -
info -
Boolean processSecureMove(/*GamesByEmail*/ game)
Gets called when the sending moves, fir processing secure move data on the client. Override to process secure data.
Overrides:processSecureMove in class Gamegame -The game object to process.
false.
processText_pieceImages(p1,
p2)
p1 -
p2 -
promotionResponse(status)
status -
promotionSubmit()
removeFromCaptured(team,
value)
team -
value -
removeFromReserve(team,
value)
team -
value -
removeFromTrades(team,
value)
team -
value -
removeOnboardFromReserve(value)
value -
Boolean sendMove(/*Boolean*/ sendNow,
/*Player*/ player)
Gets called when the Send Move button is pushed. Override and set the game state, then call Super.sendMove.
Overrides: Parameters:sendNow -(Optional) Send the moves to the server now. Else, save the move for sending later. Defaults to
true.player -(Optional) The player responsible for the move. Defaults to the current player (game.player).
true.
setBottomOnboardAsEnigma(boardPoint)
boardPoint -
setCapturedList(team,
values,
noSort)
team -
values -
noSort -
void setPerspective(/*Team*/ team)
Called when synchronizing, sets the perspective of the board based on the player. By default sets the rotation property to 0.
setPerspective in class Gameteam -The team to synchronize.
setReserveList(team,
values,
noSort)
team -
values -
noSort -
setTradeList(team,
values,
noSort)
team -
values -
noSort -
sortPieceList(value)
value -
void synch()
Called when the game should synchronize with info properties from the server.
void synchTeam(/*Team*/ team)
Called to synchronize the team properties with the raw team data. Just the color and title properties are set by default, override to set more.
team -The team to synchronize.
titlesSetCapturedVisibility(hidden)
hidden -
titlesSetCapturedVisibilityAtIndex(hidden,
index)
hidden -
index -
tradingAcceptingGetLogEntries()
tradingAddIndexToTable(index)
index -
tradingAddPiecesToTable(pieces)
pieces -
tradingCalculateTotal(values)
values -
tradingDecline()
tradingDeclinedAcknowledged(noUpdate)
noUpdate -
tradingDecliningGetLogEntries()
tradingGetAskingHtml()
tradingGetBeginningHtml()
tradingGetDeclinedHtml()
tradingGetDecliningHtml()
tradingGetObligitoryTradesHtml()
tradingGetPossibilities(pieces)
pieces -
tradingGetRespondHtml()
tradingGetSuggestionHtml(pieces)
pieces -
tradingGetTabledPieceHtml(value,
addMouseEvent)
value -
addMouseEvent -
tradingGetTabledPiecesHtml(values,
addMouseEvents)
values -
addMouseEvents -
tradingGetTeamTradingSpaceHtml(team,
addMouseEvents)
team -
addMouseEvents -
tradingIsReadyToSend()
tradingMaybeShowBox()
tradingOfferingGetLogEntries()
tradingOnSendMove()
tradingOrderPieces(pieces)
pieces -
tradingParePossibilities(possibilities,
pareType,
value)
possibilities -
pareType -
value -
tradingPossibiltyToString()
tradingPushPossibilities(possibilities,
pieces,
rest,
size)
possibilities -
pieces -
rest -
size -
tradingRemovePiecesFromTable(pieces)
pieces -
void undo(/*Boolean*/ skipUpdate)
Undos all moves since the last synch method call. The synch and update methods will be called again.
skipUpdate -(Optional) Skips the update call if true. Defaults to false.
undoBeginCommand()
undoBeginCommand_flip(boardPoint)
boardPoint -
undoBeginCommand_move(boardPoint)
boardPoint -
undoBeginCommand_onboard()
undoBeginCommand_tradingOffering(boardPoint)
boardPoint -
undoClearRegistry()
undoCloneArguments(args)
args -
undoCloneData(data)
data -
undoCompareArguments(args1,
args2)
args1 -
args2 -
undoCompareData(data1,
data2)
data1 -
data2 -
undoGetLogEntries()
undoRegisterCommand()
undoRegisterCompareLastMove()
weCapturedAtIndex(index,
value)
index -
value -