File: Games\Viktory2\Game.js

GamesByEmail
Class Viktory2Game

Object
  
 
 
GamesByEmail.Game
 
 
GamesByEmail.Viktory2Game

All Implemented Interfaces:

Hex, Class, Elemental, Resourceful, Server


GamesByEmail.Viktory2Game

extends Game
implements GamesByEmail.Hex

Constructor Summary
GamesByEmail.Viktory2Game()

Enum Summary
static  HEX_TYPE
static  MOVE_PHASE

Field Summary
static ObjectresourcePack
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
 addAdditionalLogEntry(logEntry)
 addMapCustomizationData(data, playOptions)
 alignElementWithPiece(element, piece)
 anyBattlesPending()
 anyMovesOrBattlesLeft()
StringBuilderappendAdditionalPreferencesHtml(/*StringBuilder*/ htmlBuilder)
Override to add additional player preferences.
 appendBuildingBudgetToReserves()
 balanceExplorationOnMouseDown(screenPoint)
 battlesPendingAlert(alertType)
 boardEditorMouseDown(screenPoint)
 boardEditorRequest(editType, editValue)
StringboardValueFromValueColor(/*String*/ value, /*Number*/ color)
Gets the board value from a value and color. By default, the value is returned if color is zero, else the upper case of the value is returned.
 bombardUnitsMouseDown(screenPoint)
 bombardUnitsMouseMove(screenPoint)
 bombardUnitsMouseUp(screenPoint)
 canBalanceExploration(overideUndoLength)
 canBuildOrReserve()
 canBuildOrUpgrade()
 canDoSomethingWithReserves(notTown, notMilitary)
 centerElementOverPiece(element, piece)
 chatImageHtml(chatId)
 chatVibration()
 checkForWin(committing)
 clearMapCustomizationData(playOptions)
NumbercolorFromBoardValue(/*String*/ boardValue)
Gets the color from a board value. By default, lower case characters return 0, uppercase 1, and everything else -1.
 compileStatistics(moves)
StringcompleteYourTurnHtml(/*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.
 confirmEndReservePlacement(confirmType)
StringcontinueYourTurnHtml(/*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.
 couldPlaceReserveUnit(unitType, color, controlsCapital)
 countHitsForLog(rolls, hitThreshold, otherHits)
 countNewVisible(v1, v2)
 countWaterInMapCustomizationData(playOptions)
 createUnitCounts()
 customizeMapDoAll(doUpdate)
 customizeMapOnMouseDown(value)
 customizeMapOnMouseMove(screenPoint)
 customizeMapOnMouseUp(screenPoint)
 debugScreenPoint(screenPoint)
 defensiveLuckAveragingOnClick(checked)
 disbandObligitories(color)
 dispose()
 distanceBewteenPoints(p1, p2)
 doesColorControlTheirCapital(color)
 doneWithPhase()
 doomsdayClockHtml()
 eliminateExtraUnitsHtml()
 eliminateExtraUnitsMouseDown(screenPoint)
 eliminateExtraUnitsMouseMove(screenPoint)
 eliminateExtraUnitsMouseOut(screenPoint)
 endMyMovement()
 endMyTurn()
 everyOtherTeamHasDoomsdayClock(color)
 findTargetPoint(point)
 forfeitMapCustomization()
 forfeitPendingBattles()
 getActionLinksHtml()
//stats
 getArtilleryDifference(unitCounts)
 getBattleData()
 getBoardEditorAnchorHtml()
 getBuildables(color, rulerColor)
 getCapitalPoints(board, color, playOptions, landOnly)
 getCavalryDifference(unitCounts)
 getCombatSupplyIconHtml()
 getCommonOverlayHtml(activePiece)
 getCurrentBuildSpending(color)
 getCurrentRemovingType()
 getDataString(movePhase, board, visibility, units, battle, playOptions)
 getDefensiveLuckAveragingControlsHtml()
 getDoomsdayClockResultsHtml()
 getEnabledPlayOptionsHtml(color)
 getFrigateDifference(unitCounts)
 getGameDescriptionHtml()
 getHitThreshold(color)
 getInfantryDifference(unitCounts)
 getLastActivityPiece()
 getMapCustomizationData(playOptions)
 getMapCustomizationHtml()
 getMemoryUnits(index)
 getMoveLogFromUndoStack()
 getNewVassal()
 getNewVassalCompleteHtml()
 getNewVassalHtml()
 getNumMapCustomizations(playOptions)
 getOptionsDataString(playOptions)
 getPointPerimeterValue(point)
 getRandomAvailableLandHexValue(playOptions)
 getRemainingBuildingBudget(color)
 getReserveHtml(team)
 getReserveOnMouseDown(team)
 getReserveUnitImageHtml(unitType, color, couldPlace, onMouseDown)
 getReserveUnitTypes(color)
 getRetreatingPiece()
 getStatisticsHtml(stats)
 getStatisticsPopupHtml(popupWin)
 getTargetPlaceHolderPoint(point)
 getTargetPoint(point)
 getTeamOptionsData(playOptions)
StringgetTeamTitleHtml(/*Team*/ team, /*Boolean*/ top)
Gets the HTML for the team title on the board. By default uses resources 'turnTeamTitle' or 'teamTitle'.
 getUnitImageHtml(unitType, color, attributes)
 getUnitImageSrc()
 getUnitSheetAnchorHtml()
 getVassalReorganizationWarningHtml()
 hasDoomsdayResults()
 hiliteVisibilityDifference(vis1, vis2)
 hitPhrase(num)
voidinitialize(/*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.
voidinitializeNewGameForm(/*GameForm*/ gameForm, /*Array*/ userInfo)
Seeds the game form options with values from the current game.
PointisBoardPointHidden(/*Point*/ boardPoint)
Returns whether the board point is hidden from the current player, for games like Dark Chess.
 isLandAtPointBoard(point, board)
 isPointOnPerimeter(point)
 isTargetPoint(point)
 isTeamInOurAlliance(team)
 isUnexploredByAnyTeam(index)
 isWaterAtPointBoard(point, board)
StringitsYourTurnHtml(/*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.
 mapCustomizationDataCanSwapWater(playOptions)
 mapDataOption(data, encoding)
 matchBoardToNumPlayersAndColor(numPlayers, color)
 maybeCenterOverlay(piece)
 maybeFinishRetreat(retreatingPiece)
 maybeFinishRetreat2(retreatingPiece)
 maybeHideOverlay()
 maybeMemorizeCivilizations()
 maybeMouseOut()
 maybeReleaseFromVassalage(piece)
 maybeRequestStatistics()
 maybeResetReservesByMouseUp()
 maybeTempHideOverlay(event)
 maybeTempUnhideOverlay(event)
 maybeUndarkAdjacent(point, radius)
 maybeUndarkPiece(piece)
 militaryUnitFromScreenPoint(screenPoint, unitType, color, rulerColor, movers, bombarders, loadables, retreatables, cargoType, redeployables)
 moveBombardUnitsMouseMove(screenPoint)
 moveBombardUnitsMouseOut(screenPoint)
 moveToNextPlayer()
 moveUnitsHtml()
 moveUnitsMouseDown(screenPoint)
 moveUnitsMouseMove(screenPoint)
 moveUnitsMouseUp(screenPoint)
 mustCommitBattleResults()
 mustHandleMapCustomization()
 needsCapitalPlaced()
 needsExtrasRemoved()
 needsPennantsPlaced()
 needsPiecesReset()
 newVassalCompleteHtml()
 newVassalHtml()
 nothingLeftToDo(checkMapCustomization)
StringofferDrawHtml(/*String*/ resourceName)
Called when needing the offer-a-draw-with-this-move prompts HTML (typically a short sentence and a Offer A Draw checkbox). Override to set. Internally uses the "youMayOfferDraw" and "offerDrawWithThisMove" resources.
 openBoardEditor(event)
 openBoardEditorHtml()
 openStatistics(event)
 openStatisticsAnchorHtml()
 openUnitSheet(event)
 openUnitSheetHtml()
 overlayCommitOnClick()
 parseDataString(data)
 parseOptionsDataString(data)
 parseTeamOptionsData(data)
 pieceIndexAlreadyVisible(index)
 placeCapitalHtml()
 placeCapitalMouseDown(screenPoint)
 placeCapitalMouseMove(screenPoint)
 placeCapitalMouseOut(screenPoint)
 placeReserveOnMouseMove(screenPoint)
 placeReserveOnMouseUp(screenPoint)
 populateStatisticsWindow(popupWin)
 processBalanceExplorationMove(piece)
 processBattleCompleteMove(piece)
 processBeginRetreatUnitMove(piece)
 processBombardUnitMove(piece)
 processContinueBattleMove(piece, retreatIndices, startingBattle)
 processDoomsdayClockResults()
 processFinishCivilizationRelocationMove()
 processForNewTurn()
 processMapCustomizationMove(piece)
 processMapModificationMove(piece)
 processMovePhase()
 processMovePhaseForTeam(team)
 processMoveUnitMove()
 processNewVassalCompleteResults()
 processNewVassalResults()
 processPlaceCapitalMove(piece)
 processPlaceReserveUnitMove()
 processPreBattleMove(piece)
 processRelocateCivilizationMove()
 processRemoveCivilizationMove()
 processRetreatUnitMove()
 processSendMove()
 processStartBattleMove(piece)
 processStartReserveBattleMove(piece)
 processVassalReorganizationResults()
 pushMapCustomizationMove(piece, logData, origNum)
 pushMove(title, logEntry, piece, process, forceReady, commitTitle, undoTitle)
 pushUndoState(unitData, battleData, moveData)
 pushUniquePoint(points, point)
 qualifiesForCombatSupply(color)
 receiveStatistics(gameLog)
 redeployUnitsMouseMove(screenPoint)
 redeployUnitsMouseUp(screenPoint)
 releaseAllVassals(exRulerColor)
 relocateCivilizationMouseDown(screenPoint)
 relocateCivilizationMouseMove(screenPoint)
 relocateCivilizationMouseUp(screenPoint)
 removeExcessPieces(color, update)
 removeMapCustomizationDataValue(value)
 reserveOnMouseDown(element, event, index)
 reserveOnMouseUp(element)
 reservePhaseOnMouseDown(screenPoint)
 reservePlacementHtml(unitType)
 reserveRetreatOnMouseOver(event)
 reserveRetreatOnMouseUp(event)
 reserveUnitsHtml()
 resumeRetreating()
 resumeRulersTurn()
 retreatFromBattle(piece, hitLog)
 retreatUnitsHtml()
 retreatUnitsMouseDown(screenPoint)
 retreatUnitsMouseMove(screenPoint)
 retreatUnitsMouseUp(screenPoint)
 retreatUnitsSelectMouseMove(screenPoint)
 retreatUnitsSelectMouseOut(screenPoint)
 revealAroundPoint(point, visibility, distance)
 revealXY(x, y, visibility)
 rotateAttackIndex(index)
BooleansendMove(/*Boolean*/ sendNow, /*Player*/ player)
Gets called when the Send Move button is pushed. Override and set the game state, then call Super.sendMove.
StringsendMoveHtml(/*String*/ resourceName)
Called when needing the send-this-move prompts HTML (typically a short sentence and a Send This Move button). Override to set. Internally uses the "youMaySendYourMove" resource.
 setBalanceExploration()
 setBattleData(piece, round, attackerRolls, defenderRolls, retreats)
 setEconomicVictors(loserColor)
 setPendingBattle()
 setPerimeterValues(point, data, value)
voidsetPerspective(/*Team*/ team)
Called when synchronizing, sets the perspective of the board based on the player. By default sets the rotation property to 0.
voidsetPlayerPrefs()
Extract the player's preferences from the player.info collection, and sets properties accordingly. By default, the font and verbose properties are extracted.
 setRetreatingPiece(piece)
 setSubjugation(color, rulerColor)
 setTargetPoints(points)
 showOverlay()
 showReserveMessage(screenPoint, messageHtml)
 skipMoveUnits()
 skipMoveUnitsButtonHtml()
 sssreceiveLog(gameLog)
 swapOneWaterInMapCustomizationData(logIt, playOptions)
 swapWaterForLand()
voidsynch()
Called when the game should synchronize with info properties from the server.
voidsynchTeam(/*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.
 theHitPhrase(num)
 townPlacementHtml()
StringturnHeaderHtml(/*String*/ resourceName)
Called when needing the it's-your-turn header HTML. Override to set. Internally uses the "turnHeader" resource.
 turnPhaseHtml()
voidundo(/*Boolean*/ skipUpdate)
Undos all moves since the last synch method call. The synch and update methods will be called again.
 unitPhrase(num)
 unrelocatableMouseUp(screenPoint)
voidupdate()
Updates the team titles, the game header, the game title, all prompts and action links.
StringvalueFromBoardValue(/*String*/ boardValue)
Gets the value from a board value. By default, the lower case of the board value is returned.
 vassalReorganizationHtml()

Methods inherited from GamesByEmail.Game
aboveTeamTitleRowHtml, acceptDeclineDrawHtml, acceptDraw, acceptDrawButtonHtml, addNote, addToPage, appendBoardHtml, beginTurnHtml, belowTeamTitleRowHtml, boardPointFromScreenPoint, cancelGameButtonHtml, cancelGameHtml, checkMove, clearHilites, clearMouseEvents, closeWindowButtonHtml, closeWindowHtml, colorFromPointBoard, colorFromXYBoard, completeTurnHtml, constrainPoint, constrainRectangle, continueTurnHtml, debug, diceRolls, dieRoll, drawAcceptedHeaderHtml, drawAcceptedHtml, drawDeclinedHeaderHtml, drawDeclinedHtml, drawOfferedHeaderHtml, elementTitleAttributes, findNextPlayer, findPlayer, findWinningTeam, forEachTeam, gameInProgressHeaderHtml, gameOverHeaderHtml, gameOverHtml, getAnchorHtml, getButtonHtml, getCheckboxHtml, getGamePromptsHtml, getHeaderHtml, getHtml, getHtmlButtonHtml, getImageSrc, getNewGamePlayerOrder, getNextGamesTitle, getOptionHtml, getPieType, getPieceRect, getPieceSrc, getRadioHtml, getSelectHtml, getSpectatorAnchorHtml, getSpectatorUrl, getTeamAtDistance, getTeamFontColor, getTeamLogFontBgColor, getTeamLogFontColor, getTeamTitleAlignment, getTeamTitlesHtml, getTeamsForTitles, getTextHtml, getTextareaHtml, getTurnHtml, getTurnTeam, getVButtonHtml, handleMoveCollision, hiliteImageHtml, isColorAtPoint, isColorAtXY, isMyTurn, isPathClear, isPointBoardClear, isPointOnBoard, isValueColorAtPoint, isValueColorAtXY, isXYBoardClear, isXYOnBoard, maybePie, maybeResign, movePiece, nextTeam, notYourTurnHtml, numTeamsPlaying, offerDrawCheckBoxHtml, openLogAnchorHtml, openPlayerChatAnchorHtml, openPreferencesAnchorHtml, openRulesAnchorHtml, pie, pieButtonHtml, pieHtml, processSecureMove, refreshGame, refreshGameButtonHtml, reportProblemAnchorHtml, resign, resignButtonHtml, resignHtml, resignedHeaderHtml, screenRectFromBoardPoint, sendMoveButtonHtml, sendReminderButtonHtml, setConstrainer, setEnded, setFloatHtml, setInnerHtml, setMouseHtml, setValueAtPoint, setValueAtXY, showTransactionPrompt, spectatingHtml, startAnotherGameButtonHtml, startAnotherGameHtml, teamColorFromTeam, theyResignedHtml, tieGameHeaderHtml, titleFromTeamColor, transformHashLinksToOnClicks, undoButtonHtml, undoMoveHtml, updateTeamTitles, valueFromPointBoard, valueFromXYBoard, valueIndexFromBoardPoint, wonHeaderHtml, youLoseHtml, youResignedHtml, youTiedHtml, youWinHtml

Methods inherited from GamesByEmail.Hex
boardPointFromScreenXY, boardPointFromValueIndex, forEachBoardPoint, numInPath, screenRectFromBoardXY, valueIndexFromBoardXY

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

Viktory2Game

GamesByEmail.Viktory2Game()

Enum Detail

HEX_TYPE

static HEX_TYPE
Values:
PLAIN - 

GRASSLAND - 

FOREST - 

MOUNTAIN - 

WATER - 

CONVERT_TO_LAND - 


MOVE_PHASE

static MOVE_PHASE
Values:
RESET - 

DOOMSDAY_CLOCK - 

CAPITAL - 

RELOCATE - 

PENNANTS - 

MOVE - 

RETREAT - 

NEW_VASSAL - 

VASSAL_RESERVES - 

VASSAL_RESERVE_BATTLES - 

NEW_VASSAL_COMPLETE - 

RESERVES - 

RESERVE_BATTLES - 

OVER - 

Field Detail

resourcePack

static Object resourcePack

Resources for most of the game. Override to add resources specific to game.

Overrides:
resourcePack in class Game
See Also:
Foundation.Resourceful.resource

Method Detail

addAdditionalLogEntry

addAdditionalLogEntry(logEntry)
Parameters:
logEntry - 


addMapCustomizationData

addMapCustomizationData(data,
                        playOptions)
Parameters:
data - 

playOptions - 


alignElementWithPiece

alignElementWithPiece(element,
                      piece)
Parameters:
element - 

piece - 


anyBattlesPending

anyBattlesPending()

anyMovesOrBattlesLeft

anyMovesOrBattlesLeft()

appendAdditionalPreferencesHtml

StringBuilder appendAdditionalPreferencesHtml(/*StringBuilder*/ htmlBuilder)

Override to add additional player preferences.

Overrides:
appendAdditionalPreferencesHtml in class Game
Parameters:
htmlBuilder - 
The string builder to add the extra player preference HTML to.
Returns:
The string builder.

appendBuildingBudgetToReserves

appendBuildingBudgetToReserves()

balanceExplorationOnMouseDown

balanceExplorationOnMouseDown(screenPoint)
Parameters:
screenPoint - 


battlesPendingAlert

battlesPendingAlert(alertType)
Parameters:
alertType - 


boardEditorMouseDown

boardEditorMouseDown(screenPoint)
Parameters:
screenPoint - 


boardEditorRequest

boardEditorRequest(editType,
                   editValue)
Parameters:
editType - 

editValue - 


boardValueFromValueColor

String boardValueFromValueColor(/*String*/ value,
                                /*Number*/ color)

Gets the board value from a value and color. By default, the value is returned if color is zero, else the upper case of the value is returned.

Overrides:
boardValueFromValueColor in class Game
Parameters:
value - 
The value.
color - 
The color.
Returns:
The board value.

bombardUnitsMouseDown

bombardUnitsMouseDown(screenPoint)
Parameters:
screenPoint - 


bombardUnitsMouseMove

bombardUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


bombardUnitsMouseUp

bombardUnitsMouseUp(screenPoint)
Parameters:
screenPoint - 


canBalanceExploration

canBalanceExploration(overideUndoLength)
Parameters:
overideUndoLength - 


canBuildOrReserve

canBuildOrReserve()

canBuildOrUpgrade

canBuildOrUpgrade()

canDoSomethingWithReserves

canDoSomethingWithReserves(notTown,
                           notMilitary)
Parameters:
notTown - 

notMilitary - 


centerElementOverPiece

centerElementOverPiece(element,
                       piece)
Parameters:
element - 

piece - 


chatImageHtml

chatImageHtml(chatId)
Parameters:
chatId - 


chatVibration

chatVibration()

checkForWin

checkForWin(committing)
Parameters:
committing - 


clearMapCustomizationData

clearMapCustomizationData(playOptions)
Parameters:
playOptions - 


colorFromBoardValue

Number colorFromBoardValue(/*String*/ boardValue)

Gets the color from a board value. By default, lower case characters return 0, uppercase 1, and everything else -1.

Overrides:
colorFromBoardValue in class Game
Parameters:
boardValue - 
The value to check, by default a single character.
Returns:
The color number.

compileStatistics

compileStatistics(moves)
Parameters:
moves - 


completeYourTurnHtml

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 Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the game prompts.

confirmEndReservePlacement

confirmEndReservePlacement(confirmType)
Parameters:
confirmType - 


continueYourTurnHtml

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 Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the game prompts.

couldPlaceReserveUnit

couldPlaceReserveUnit(unitType,
                      color,
                      controlsCapital)
Parameters:
unitType - 

color - 

controlsCapital - 


countHitsForLog

countHitsForLog(rolls,
                hitThreshold,
                otherHits)
Parameters:
rolls - 

hitThreshold - 

otherHits - 


countNewVisible

countNewVisible(v1,
                v2)
Parameters:
v1 - 

v2 - 


countWaterInMapCustomizationData

countWaterInMapCustomizationData(playOptions)
Parameters:
playOptions - 


createUnitCounts

createUnitCounts()

customizeMapDoAll

customizeMapDoAll(doUpdate)
Parameters:
doUpdate - 


customizeMapOnMouseDown

customizeMapOnMouseDown(value)
Parameters:
value - 


customizeMapOnMouseMove

customizeMapOnMouseMove(screenPoint)
Parameters:
screenPoint - 


customizeMapOnMouseUp

customizeMapOnMouseUp(screenPoint)
Parameters:
screenPoint - 


debugScreenPoint

debugScreenPoint(screenPoint)
Parameters:
screenPoint - 


defensiveLuckAveragingOnClick

defensiveLuckAveragingOnClick(checked)
Parameters:
checked - 


disbandObligitories

disbandObligitories(color)
Parameters:
color - 


dispose

dispose()
Overrides:
dispose in class Game

distanceBewteenPoints

distanceBewteenPoints(p1,
                      p2)
Parameters:
p1 - 

p2 - 


doesColorControlTheirCapital

doesColorControlTheirCapital(color)
Parameters:
color - 


doneWithPhase

doneWithPhase()

doomsdayClockHtml

doomsdayClockHtml()

eliminateExtraUnitsHtml

eliminateExtraUnitsHtml()

eliminateExtraUnitsMouseDown

eliminateExtraUnitsMouseDown(screenPoint)
Parameters:
screenPoint - 


eliminateExtraUnitsMouseMove

eliminateExtraUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


eliminateExtraUnitsMouseOut

eliminateExtraUnitsMouseOut(screenPoint)
Parameters:
screenPoint - 


endMyMovement

endMyMovement()

endMyTurn

endMyTurn()

everyOtherTeamHasDoomsdayClock

everyOtherTeamHasDoomsdayClock(color)
Parameters:
color - 


findTargetPoint

findTargetPoint(point)
Parameters:
point - 


forfeitMapCustomization

forfeitMapCustomization()

forfeitPendingBattles

forfeitPendingBattles()

getActionLinksHtml

getActionLinksHtml()

//stats

Overrides:
getActionLinksHtml in class Game

getArtilleryDifference

getArtilleryDifference(unitCounts)
Parameters:
unitCounts - 


getBattleData

getBattleData()

getBoardEditorAnchorHtml

getBoardEditorAnchorHtml()

getBuildables

getBuildables(color,
              rulerColor)
Parameters:
color - 

rulerColor - 


getCapitalPoints

getCapitalPoints(board,
                 color,
                 playOptions,
                 landOnly)
Parameters:
board - 

color - 

playOptions - 

landOnly - 


getCavalryDifference

getCavalryDifference(unitCounts)
Parameters:
unitCounts - 


getCombatSupplyIconHtml

getCombatSupplyIconHtml()

getCommonOverlayHtml

getCommonOverlayHtml(activePiece)
Parameters:
activePiece - 


getCurrentBuildSpending

getCurrentBuildSpending(color)
Parameters:
color - 


getCurrentRemovingType

getCurrentRemovingType()

getDataString

getDataString(movePhase,
              board,
              visibility,
              units,
              battle,
              playOptions)
Parameters:
movePhase - 

board - 

visibility - 

units - 

battle - 

playOptions - 


getDefensiveLuckAveragingControlsHtml

getDefensiveLuckAveragingControlsHtml()

getDoomsdayClockResultsHtml

getDoomsdayClockResultsHtml()

getEnabledPlayOptionsHtml

getEnabledPlayOptionsHtml(color)
Parameters:
color - 


getFrigateDifference

getFrigateDifference(unitCounts)
Parameters:
unitCounts - 


getGameDescriptionHtml

getGameDescriptionHtml()

getHitThreshold

getHitThreshold(color)
Parameters:
color - 


getInfantryDifference

getInfantryDifference(unitCounts)
Parameters:
unitCounts - 


getLastActivityPiece

getLastActivityPiece()

getMapCustomizationData

getMapCustomizationData(playOptions)
Parameters:
playOptions - 


getMapCustomizationHtml

getMapCustomizationHtml()

getMemoryUnits

getMemoryUnits(index)
Parameters:
index - 


getMoveLogFromUndoStack

getMoveLogFromUndoStack()

getNewVassal

getNewVassal()

getNewVassalCompleteHtml

getNewVassalCompleteHtml()

getNewVassalHtml

getNewVassalHtml()

getNumMapCustomizations

getNumMapCustomizations(playOptions)
Parameters:
playOptions - 


getOptionsDataString

getOptionsDataString(playOptions)
Parameters:
playOptions - 


getPointPerimeterValue

getPointPerimeterValue(point)
Parameters:
point - 


getRandomAvailableLandHexValue

getRandomAvailableLandHexValue(playOptions)
Parameters:
playOptions - 


getRemainingBuildingBudget

getRemainingBuildingBudget(color)
Parameters:
color - 


getReserveHtml

getReserveHtml(team)
Parameters:
team - 


getReserveOnMouseDown

getReserveOnMouseDown(team)
Parameters:
team - 


getReserveUnitImageHtml

getReserveUnitImageHtml(unitType,
                        color,
                        couldPlace,
                        onMouseDown)
Parameters:
unitType - 

color - 

couldPlace - 

onMouseDown - 


getReserveUnitTypes

getReserveUnitTypes(color)
Parameters:
color - 


getRetreatingPiece

getRetreatingPiece()

getStatisticsHtml

getStatisticsHtml(stats)
Parameters:
stats - 


getStatisticsPopupHtml

getStatisticsPopupHtml(popupWin)
Parameters:
popupWin - 


getTargetPlaceHolderPoint

getTargetPlaceHolderPoint(point)
Parameters:
point - 


getTargetPoint

getTargetPoint(point)
Parameters:
point - 


getTeamOptionsData

getTeamOptionsData(playOptions)
Parameters:
playOptions - 


getTeamTitleHtml

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 Game
Parameters:
team - 
The team to get the color for.
top - 
Whether this team's title will be displayed above the board or below.
Returns:
The log background color.

getUnitImageHtml

getUnitImageHtml(unitType,
                 color,
                 attributes)
Parameters:
unitType - 

color - 

attributes - 


getUnitImageSrc

getUnitImageSrc()

getUnitSheetAnchorHtml

getUnitSheetAnchorHtml()

getVassalReorganizationWarningHtml

getVassalReorganizationWarningHtml()

hasDoomsdayResults

hasDoomsdayResults()

hiliteVisibilityDifference

hiliteVisibilityDifference(vis1,
                           vis2)
Parameters:
vis1 - 

vis2 - 


hitPhrase

hitPhrase(num)
Parameters:
num - 


initialize

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 Game
Parameters:
numPlayers - 
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);
   }

initializeNewGameForm

void initializeNewGameForm(/*GameForm*/ gameForm,
                           /*Array*/ userInfo)

Seeds the game form options with values from the current game.

Overrides:
initializeNewGameForm in class Game
Parameters:
gameForm - 
The game form to seed.
userInfo - 
An array of user information.

isBoardPointHidden

Point isBoardPointHidden(/*Point*/ boardPoint)

Returns whether the board point is hidden from the current player, for games like Dark Chess.

Overrides:
isBoardPointHidden in class Game
Parameters:
boardPoint - 
The board point.
Returns:
The board point.

isLandAtPointBoard

isLandAtPointBoard(point,
                   board)
Parameters:
point - 

board - 


isPointOnPerimeter

isPointOnPerimeter(point)
Parameters:
point - 


isTargetPoint

isTargetPoint(point)
Parameters:
point - 


isTeamInOurAlliance

isTeamInOurAlliance(team)
Parameters:
team - 


isUnexploredByAnyTeam

isUnexploredByAnyTeam(index)
Parameters:
index - 


isWaterAtPointBoard

isWaterAtPointBoard(point,
                    board)
Parameters:
point - 

board - 


itsYourTurnHtml

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 Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the game prompts.

mapCustomizationDataCanSwapWater

mapCustomizationDataCanSwapWater(playOptions)
Parameters:
playOptions - 


mapDataOption

mapDataOption(data,
              encoding)
Parameters:
data - 

encoding - 


matchBoardToNumPlayersAndColor

matchBoardToNumPlayersAndColor(numPlayers,
                               color)
Parameters:
numPlayers - 

color - 


maybeCenterOverlay

maybeCenterOverlay(piece)
Parameters:
piece - 


maybeFinishRetreat

maybeFinishRetreat(retreatingPiece)
Parameters:
retreatingPiece - 


maybeFinishRetreat2

maybeFinishRetreat2(retreatingPiece)
Parameters:
retreatingPiece - 


maybeHideOverlay

maybeHideOverlay()

maybeMemorizeCivilizations

maybeMemorizeCivilizations()

maybeMouseOut

maybeMouseOut()

maybeReleaseFromVassalage

maybeReleaseFromVassalage(piece)
Parameters:
piece - 


maybeRequestStatistics

maybeRequestStatistics()

maybeResetReservesByMouseUp

maybeResetReservesByMouseUp()

maybeTempHideOverlay

maybeTempHideOverlay(event)
Parameters:
event - 


maybeTempUnhideOverlay

maybeTempUnhideOverlay(event)
Parameters:
event - 


maybeUndarkAdjacent

maybeUndarkAdjacent(point,
                    radius)
Parameters:
point - 

radius - 


maybeUndarkPiece

maybeUndarkPiece(piece)
Parameters:
piece - 


militaryUnitFromScreenPoint

militaryUnitFromScreenPoint(screenPoint,
                            unitType,
                            color,
                            rulerColor,
                            movers,
                            bombarders,
                            loadables,
                            retreatables,
                            cargoType,
                            redeployables)
Parameters:
screenPoint - 

unitType - 

color - 

rulerColor - 

movers - 

bombarders - 

loadables - 

retreatables - 

cargoType - 

redeployables - 


moveBombardUnitsMouseMove

moveBombardUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


moveBombardUnitsMouseOut

moveBombardUnitsMouseOut(screenPoint)
Parameters:
screenPoint - 


moveToNextPlayer

moveToNextPlayer()

moveUnitsHtml

moveUnitsHtml()

moveUnitsMouseDown

moveUnitsMouseDown(screenPoint)
Parameters:
screenPoint - 


moveUnitsMouseMove

moveUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


moveUnitsMouseUp

moveUnitsMouseUp(screenPoint)
Parameters:
screenPoint - 


mustCommitBattleResults

mustCommitBattleResults()

mustHandleMapCustomization

mustHandleMapCustomization()

needsCapitalPlaced

needsCapitalPlaced()

needsExtrasRemoved

needsExtrasRemoved()

needsPennantsPlaced

needsPennantsPlaced()

needsPiecesReset

needsPiecesReset()

newVassalCompleteHtml

newVassalCompleteHtml()

newVassalHtml

newVassalHtml()

nothingLeftToDo

nothingLeftToDo(checkMapCustomization)
Parameters:
checkMapCustomization - 


offerDrawHtml

String offerDrawHtml(/*String*/ resourceName)

Called when needing the offer-a-draw-with-this-move prompts HTML (typically a short sentence and a Offer A Draw checkbox). Override to set. Internally uses the "youMayOfferDraw" and "offerDrawWithThisMove" resources.

Overrides:
offerDrawHtml in class Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the game prompts.

openBoardEditor

openBoardEditor(event)
Parameters:
event - 


openBoardEditorHtml

openBoardEditorHtml()

openStatistics

openStatistics(event)
Parameters:
event - 


openStatisticsAnchorHtml

openStatisticsAnchorHtml()

openUnitSheet

openUnitSheet(event)
Parameters:
event - 


openUnitSheetHtml

openUnitSheetHtml()

overlayCommitOnClick

overlayCommitOnClick()

parseDataString

parseDataString(data)
Parameters:
data - 


parseOptionsDataString

parseOptionsDataString(data)
Parameters:
data - 


parseTeamOptionsData

parseTeamOptionsData(data)
Parameters:
data - 


pieceIndexAlreadyVisible

pieceIndexAlreadyVisible(index)
Parameters:
index - 


placeCapitalHtml

placeCapitalHtml()

placeCapitalMouseDown

placeCapitalMouseDown(screenPoint)
Parameters:
screenPoint - 


placeCapitalMouseMove

placeCapitalMouseMove(screenPoint)
Parameters:
screenPoint - 


placeCapitalMouseOut

placeCapitalMouseOut(screenPoint)
Parameters:
screenPoint - 


placeReserveOnMouseMove

placeReserveOnMouseMove(screenPoint)
Parameters:
screenPoint - 


placeReserveOnMouseUp

placeReserveOnMouseUp(screenPoint)
Parameters:
screenPoint - 


populateStatisticsWindow

populateStatisticsWindow(popupWin)
Parameters:
popupWin - 


processBalanceExplorationMove

processBalanceExplorationMove(piece)
Parameters:
piece - 


processBattleCompleteMove

processBattleCompleteMove(piece)
Parameters:
piece - 


processBeginRetreatUnitMove

processBeginRetreatUnitMove(piece)
Parameters:
piece - 


processBombardUnitMove

processBombardUnitMove(piece)
Parameters:
piece - 


processContinueBattleMove

processContinueBattleMove(piece,
                          retreatIndices,
                          startingBattle)
Parameters:
piece - 

retreatIndices - 

startingBattle - 


processDoomsdayClockResults

processDoomsdayClockResults()

processFinishCivilizationRelocationMove

processFinishCivilizationRelocationMove()

processForNewTurn

processForNewTurn()

processMapCustomizationMove

processMapCustomizationMove(piece)
Parameters:
piece - 


processMapModificationMove

processMapModificationMove(piece)
Parameters:
piece - 


processMovePhase

processMovePhase()

processMovePhaseForTeam

processMovePhaseForTeam(team)
Parameters:
team - 


processMoveUnitMove

processMoveUnitMove()

processNewVassalCompleteResults

processNewVassalCompleteResults()

processNewVassalResults

processNewVassalResults()

processPlaceCapitalMove

processPlaceCapitalMove(piece)
Parameters:
piece - 


processPlaceReserveUnitMove

processPlaceReserveUnitMove()

processPreBattleMove

processPreBattleMove(piece)
Parameters:
piece - 


processRelocateCivilizationMove

processRelocateCivilizationMove()

processRemoveCivilizationMove

processRemoveCivilizationMove()

processRetreatUnitMove

processRetreatUnitMove()

processSendMove

processSendMove()

processStartBattleMove

processStartBattleMove(piece)
Parameters:
piece - 


processStartReserveBattleMove

processStartReserveBattleMove(piece)
Parameters:
piece - 


processVassalReorganizationResults

processVassalReorganizationResults()

pushMapCustomizationMove

pushMapCustomizationMove(piece,
                         logData,
                         origNum)
Parameters:
piece - 

logData - 

origNum - 


pushMove

pushMove(title,
         logEntry,
         piece,
         process,
         forceReady,
         commitTitle,
         undoTitle)
Parameters:
title - 

logEntry - 

piece - 

process - 

forceReady - 

commitTitle - 

undoTitle - 


pushUndoState

pushUndoState(unitData,
              battleData,
              moveData)
Parameters:
unitData - 

battleData - 

moveData - 


pushUniquePoint

pushUniquePoint(points,
                point)
Parameters:
points - 

point - 


qualifiesForCombatSupply

qualifiesForCombatSupply(color)
Parameters:
color - 


receiveStatistics

receiveStatistics(gameLog)
Parameters:
gameLog - 


redeployUnitsMouseMove

redeployUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


redeployUnitsMouseUp

redeployUnitsMouseUp(screenPoint)
Parameters:
screenPoint - 


releaseAllVassals

releaseAllVassals(exRulerColor)
Parameters:
exRulerColor - 


relocateCivilizationMouseDown

relocateCivilizationMouseDown(screenPoint)
Parameters:
screenPoint - 


relocateCivilizationMouseMove

relocateCivilizationMouseMove(screenPoint)
Parameters:
screenPoint - 


relocateCivilizationMouseUp

relocateCivilizationMouseUp(screenPoint)
Parameters:
screenPoint - 


removeExcessPieces

removeExcessPieces(color,
                   update)
Parameters:
color - 

update - 


removeMapCustomizationDataValue

removeMapCustomizationDataValue(value)
Parameters:
value - 


reserveOnMouseDown

reserveOnMouseDown(element,
                   event,
                   index)
Parameters:
element - 

event - 

index - 


reserveOnMouseUp

reserveOnMouseUp(element)
Parameters:
element - 


reservePhaseOnMouseDown

reservePhaseOnMouseDown(screenPoint)
Parameters:
screenPoint - 


reservePlacementHtml

reservePlacementHtml(unitType)
Parameters:
unitType - 


reserveRetreatOnMouseOver

reserveRetreatOnMouseOver(event)
Parameters:
event - 


reserveRetreatOnMouseUp

reserveRetreatOnMouseUp(event)
Parameters:
event - 


reserveUnitsHtml

reserveUnitsHtml()

resumeRetreating

resumeRetreating()

resumeRulersTurn

resumeRulersTurn()

retreatFromBattle

retreatFromBattle(piece,
                  hitLog)
Parameters:
piece - 

hitLog - 


retreatUnitsHtml

retreatUnitsHtml()

retreatUnitsMouseDown

retreatUnitsMouseDown(screenPoint)
Parameters:
screenPoint - 


retreatUnitsMouseMove

retreatUnitsMouseMove(screenPoint)
Parameters:
screenPoint - 


retreatUnitsMouseUp

retreatUnitsMouseUp(screenPoint)
Parameters:
screenPoint - 


retreatUnitsSelectMouseMove

retreatUnitsSelectMouseMove(screenPoint)
Parameters:
screenPoint - 


retreatUnitsSelectMouseOut

retreatUnitsSelectMouseOut(screenPoint)
Parameters:
screenPoint - 


revealAroundPoint

revealAroundPoint(point,
                  visibility,
                  distance)
Parameters:
point - 

visibility - 

distance - 


revealXY

revealXY(x,
         y,
         visibility)
Parameters:
x - 

y - 

visibility - 


rotateAttackIndex

rotateAttackIndex(index)
Parameters:
index - 


sendMove

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:
sendMove in class Game
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).
Returns:
true.

sendMoveHtml

String sendMoveHtml(/*String*/ resourceName)

Called when needing the send-this-move prompts HTML (typically a short sentence and a Send This Move button). Override to set. Internally uses the "youMaySendYourMove" resource.

Overrides:
sendMoveHtml in class Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the game prompts.

setBalanceExploration

setBalanceExploration()

setBattleData

setBattleData(piece,
              round,
              attackerRolls,
              defenderRolls,
              retreats)
Parameters:
piece - 

round - 

attackerRolls - 

defenderRolls - 

retreats - 


setEconomicVictors

setEconomicVictors(loserColor)
Parameters:
loserColor - 


setPendingBattle

setPendingBattle()

setPerimeterValues

setPerimeterValues(point,
                   data,
                   value)
Parameters:
point - 

data - 

value - 


setPerspective

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.

Overrides:
setPerspective in class Game
Parameters:
team - 
The team to synchronize.

setPlayerPrefs

void setPlayerPrefs()

Extract the player's preferences from the player.info collection, and sets properties accordingly. By default, the font and verbose properties are extracted.

Overrides:
setPlayerPrefs in class Game

setRetreatingPiece

setRetreatingPiece(piece)
Parameters:
piece - 


setSubjugation

setSubjugation(color,
               rulerColor)
Parameters:
color - 

rulerColor - 


setTargetPoints

setTargetPoints(points)
Parameters:
points - 


showOverlay

showOverlay()

showReserveMessage

showReserveMessage(screenPoint,
                   messageHtml)
Parameters:
screenPoint - 

messageHtml - 


skipMoveUnits

skipMoveUnits()

skipMoveUnitsButtonHtml

skipMoveUnitsButtonHtml()

sssreceiveLog

sssreceiveLog(gameLog)
Parameters:
gameLog - 


swapOneWaterInMapCustomizationData

swapOneWaterInMapCustomizationData(logIt,
                                   playOptions)
Parameters:
logIt - 

playOptions - 


swapWaterForLand

swapWaterForLand()

synch

void synch()

Called when the game should synchronize with info properties from the server.

Overrides:
synch in class Game
Notes:
The game should set tangible properties or states for each custom property set in the info collection. The info collection should not be referenced outside the scope of the synch or sendMove methods.

synchTeam

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.

Overrides:
synchTeam in class Game
Parameters:
team - 
The team to synchronize.

theHitPhrase

theHitPhrase(num)
Parameters:
num - 


townPlacementHtml

townPlacementHtml()

turnHeaderHtml

String turnHeaderHtml(/*String*/ resourceName)

Called when needing the it's-your-turn header HTML. Override to set. Internally uses the "turnHeader" resource.

Overrides:
turnHeaderHtml in class Game
Parameters:
resourceName - 
(Optional) A resource name to override the default resource to use.
Returns:
HTML for the header.

turnPhaseHtml

turnPhaseHtml()

undo

void undo(/*Boolean*/ skipUpdate)

Undos all moves since the last synch method call. The synch and update methods will be called again.

Overrides:
undo in class Game
Parameters:
skipUpdate - 
(Optional) Skips the update call if true. Defaults to false.

unitPhrase

unitPhrase(num)
Parameters:
num - 


unrelocatableMouseUp

unrelocatableMouseUp(screenPoint)
Parameters:
screenPoint - 


update

void update()

Updates the team titles, the game header, the game title, all prompts and action links.

Overrides:
update in class Game

valueFromBoardValue

String valueFromBoardValue(/*String*/ boardValue)

Gets the value from a board value. By default, the lower case of the board value is returned.

Overrides:
valueFromBoardValue in class Game
Parameters:
boardValue - 
The value to check, by default a single character.
Returns:
The value.

vassalReorganizationHtml

vassalReorganizationHtml()