File: Games\Politics\Game.js

GamesByEmail
Class PoliticsGame

Object
  
 
 
GamesByEmail.Game
 
 
GamesByEmail.PoliticsGame

All Implemented Interfaces:

Class, Elemental, Resourceful, Server


GamesByEmail.PoliticsGame

extends Game

Constructor Summary
GamesByEmail.PoliticsGame()

Enum Summary
static  COLOR

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
 addImpliedOrders(orders)
 adjudicateOrders(alwaysUpdate)
 adjudicateOrdersIfTesting(alwaysUpdate)
 allOtherTeamsOnlyHaveDefaultOrders()
 anyDisolvesOrBuilds()
 applyOrders()
 areAllPlayersAccountedFor()
 attackOrdersMouseDown(point, event)
 attackOrdersMouseMove(point)
 attackOrdersMouseUp(point)
 canEveryPieceMove(list)
 changeOrdersAnchorHtml(territory, lineThrough)
 changeOrdersByIndex(index)
 chatImageHtml(chatId)
 chatVibration()
 checkForWinner()
 checkHealth(teams)
 checkIfLost(team)
 clearOrderPredictions()
 closeAvailableOrdersBox()
 closeMapEditor()
 closeMapEditorAnchorHtml()
 colorCountDisolves(color)
 colorHasDisolves(color)
 colorHasDisolvesOrBuilds(color)
 disolveBuildOrdersMouseDown(point, event)
 disolveBuildOrdersMouseUp(point)
 disolveOrBuildHtml()
 dispose()
 doWeWantToSupportThisAttack(attackT, fromT, toT, midT)
 editMapOnMouseDown(color, unitType)
 editMapOnMouseMove(point)
 editMapOnMouseUp(point)
StringgetActionLinksHtml()
Creates HTML for a action links: Open log, open rules, open preferences, and report problem anchors.
 getAdjacentCoastForTrain(t1, t2)
 getAttackOrders(point)
static  getCoastIndexFromBoardIndex(index)
 getDaysPhrase(days)
StringgetHeaderHtml(/*String*/ resourceName)
Called when needing the header HTML. Override to set. Internally returns either gameInProgressHeaderHtml or gameOverHeaderHtml.
 getHoursPhrase(hours)
 getMinutesPhrase(minutes)
 getRetreatOrders(point)
 getSecondsPhrase(seconds)
 getSecondsToExpire()
 getShortTimeToExpireString(seconds)
 getSupplyCenterPhrase(num)
StringgetTeamTitleHtml(/*Team*/ team, /*Boolean*/ top)
Gets the HTML for the team title on the board. By default uses resources 'turnTeamTitle' or 'teamTitle'.
StringgetTeamTitlesHtml(/*Boolean*/ top)
Gets the HTML for the team titles on the board.
static  getTerritoryIndexFromBoardIndex(index)
 getTimeLimitHtml(needToTurnInOrders)
 getTimeToExpireHtml()
 getTimeToExpireString(seconds)
StringgetTurnHtml()
Called when needing the it-is-your-turn game prompts HTML. Override to set. Internally returns either beginTurnHtml, continueTurnHtml or completeTurnHtml.
 getUnitPhrase(num)
voidhandleMoveCollision(/*Object*/ gameData, /*Array*/ collisionMoves)
Override to handle move collisions from concurrent turns.
 incrementPhase(commit)
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.
 isOrderCrazy(order)
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.
 missingRetreatsInLog(s1, mp1, s2, mp2)
 mustTurnInOrdersHtml(needToTurnInOrders)
 needToTurnInOrders()
StringnotYourTurnHtml(/*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.
 noteOrphanedOrders(orders)
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.
 openJudge()
 openJudgeAnchorHtml()
 openMapEditor()
 openMapEditorAnchorHtml()
 orderTableHtml(noteOrphaned)
 orderTerritoryDescriptionHtml(tIndex, cIndex, unitType)
 orderUnitImageHtml(order)
 packGameData(gamePhase, movePhase, orderPhase, board, orders, lastTimeOrdersTurnedIn, orderTimeLimit)
 processOrders(commit)
 processOrdersButtonHtml()
 processOrdersHtml(justTheTable)
BooleanprocessSecureMove(/*GamesByEmail*/ game)
Gets called when the sending moves, fir processing secure move data on the client. Override to process secure data.
 replaceOverriddenOrders(orders, oOrders)
 reportOrderImageError(src)
 resetOrdersIfTesting()
voidresign()
Resignes the current player. Clears mouse events, sets the player as resigned, and sends the move.
 retreatOrDisbandHtml()
 retreatOrdersMouseDown(point, event)
 retreatOrdersMouseMove(point)
 retreatOrdersMouseUp(point)
 seasonFromGamePhase(gamePhase)
 sendOrderImageErrors()
 sendOrderImageErrorsResponse(response)
 setMouseTerritoriesByPoint(point, noRepeats)
 setOrdersForNewPhase()
 setTurnsForTeamsToGiveOrders()
 shortOrderDescriptionHtml(order, orders)
 showExample(notation)
StringspectatingHtml()
Called when needing the you-are-spectating game prompts HTML. Override to set. Internally returns the following combined: refreshGameButtonHtml and closeWindowButtonHtml.
 standardExamplesHtml()
 submitDefaultOrders()
 submitDefaultOrdersButtonHtml()
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.
NumberteamColorFromTeam(/*Team*/ team)
Gets the team color.
 testOrderImageFor404(e)
 testingOrdersHtml()
StringturnHeaderHtml(/*String*/ resourceName)
Called when needing the it's-your-turn header HTML. Override to set. Internally uses the "turnHeader" resource.
 turnInOrders(emptyOrders, forced)
 turnInOrdersButtonHtml(newOrdersToTurnIn)
 turnInOrdersOnClick()
 undoAnchorHtml()
 unitImageHtml(color, unitType)
 unpackGameData(data)
 updateExpirePhrase()
 updateOrderImages(overrideOrders)
 waitingForOrders()
 weHaveDisolves()
 weHaveDisolvesOrBuilds()
 weHaveUnits(dislodged)
 whoAreWeWaitingOnHtml()
 writeOrdersHtml()
 yearFromGamePhase(gamePhase)

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

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

PoliticsGame

GamesByEmail.PoliticsGame()

Enum Detail

COLOR

static COLOR
Values:
AUSTRIA_HUNGARY - 

ITALY - 

FRANCE - 

ENGLAND - 

GERMANY - 

RUSSIA - 

TURKEY - 

NEUTRAL - 

WATER - 

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

addImpliedOrders

addImpliedOrders(orders)
Parameters:
orders - 


adjudicateOrders

adjudicateOrders(alwaysUpdate)
Parameters:
alwaysUpdate - 


adjudicateOrdersIfTesting

adjudicateOrdersIfTesting(alwaysUpdate)
Parameters:
alwaysUpdate - 


allOtherTeamsOnlyHaveDefaultOrders

allOtherTeamsOnlyHaveDefaultOrders()

anyDisolvesOrBuilds

anyDisolvesOrBuilds()

applyOrders

applyOrders()

areAllPlayersAccountedFor

areAllPlayersAccountedFor()

attackOrdersMouseDown

attackOrdersMouseDown(point,
                      event)
Parameters:
point - 

event - 


attackOrdersMouseMove

attackOrdersMouseMove(point)
Parameters:
point - 


attackOrdersMouseUp

attackOrdersMouseUp(point)
Parameters:
point - 


canEveryPieceMove

canEveryPieceMove(list)
Parameters:
list - 


changeOrdersAnchorHtml

changeOrdersAnchorHtml(territory,
                       lineThrough)
Parameters:
territory - 

lineThrough - 


changeOrdersByIndex

changeOrdersByIndex(index)
Parameters:
index - 


chatImageHtml

chatImageHtml(chatId)
Parameters:
chatId - 


chatVibration

chatVibration()

checkForWinner

checkForWinner()

checkHealth

checkHealth(teams)
Parameters:
teams - 


checkIfLost

checkIfLost(team)
Parameters:
team - 


clearOrderPredictions

clearOrderPredictions()

closeAvailableOrdersBox

closeAvailableOrdersBox()

closeMapEditor

closeMapEditor()

closeMapEditorAnchorHtml

closeMapEditorAnchorHtml()

colorCountDisolves

colorCountDisolves(color)
Parameters:
color - 


colorHasDisolves

colorHasDisolves(color)
Parameters:
color - 


colorHasDisolvesOrBuilds

colorHasDisolvesOrBuilds(color)
Parameters:
color - 


disolveBuildOrdersMouseDown

disolveBuildOrdersMouseDown(point,
                            event)
Parameters:
point - 

event - 


disolveBuildOrdersMouseUp

disolveBuildOrdersMouseUp(point)
Parameters:
point - 


disolveOrBuildHtml

disolveOrBuildHtml()

dispose

dispose()
Overrides:
dispose in class Game

doWeWantToSupportThisAttack

doWeWantToSupportThisAttack(attackT,
                            fromT,
                            toT,
                            midT)
Parameters:
attackT - 

fromT - 

toT - 

midT - 


editMapOnMouseDown

editMapOnMouseDown(color,
                   unitType)
Parameters:
color - 

unitType - 


editMapOnMouseMove

editMapOnMouseMove(point)
Parameters:
point - 


editMapOnMouseUp

editMapOnMouseUp(point)
Parameters:
point - 


getActionLinksHtml

String getActionLinksHtml()

Creates HTML for a action links: Open log, open rules, open preferences, and report problem anchors.

Overrides:
getActionLinksHtml in class Game
Returns:
HTML for the action links.

getAdjacentCoastForTrain

getAdjacentCoastForTrain(t1,
                         t2)
Parameters:
t1 - 

t2 - 


getAttackOrders

getAttackOrders(point)
Parameters:
point - 


getCoastIndexFromBoardIndex

static getCoastIndexFromBoardIndex(index)
Parameters:
index - 


getDaysPhrase

getDaysPhrase(days)
Parameters:
days - 


getHeaderHtml

String getHeaderHtml(/*String*/ resourceName)

Called when needing the header HTML. Override to set. Internally returns either gameInProgressHeaderHtml or gameOverHeaderHtml.

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

getHoursPhrase

getHoursPhrase(hours)
Parameters:
hours - 


getMinutesPhrase

getMinutesPhrase(minutes)
Parameters:
minutes - 


getRetreatOrders

getRetreatOrders(point)
Parameters:
point - 


getSecondsPhrase

getSecondsPhrase(seconds)
Parameters:
seconds - 


getSecondsToExpire

getSecondsToExpire()

getShortTimeToExpireString

getShortTimeToExpireString(seconds)
Parameters:
seconds - 


getSupplyCenterPhrase

getSupplyCenterPhrase(num)
Parameters:
num - 


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.

getTeamTitlesHtml

String getTeamTitlesHtml(/*Boolean*/ top)

Gets the HTML for the team titles on the board.

Overrides:
getTeamTitlesHtml in class Game
Parameters:
top - 
Whether this teams' titles will be displayed above the board or below.
Returns:
The titles for all teams across the top or bottom.

getTerritoryIndexFromBoardIndex

static getTerritoryIndexFromBoardIndex(index)
Parameters:
index - 


getTimeLimitHtml

getTimeLimitHtml(needToTurnInOrders)
Parameters:
needToTurnInOrders - 


getTimeToExpireHtml

getTimeToExpireHtml()

getTimeToExpireString

getTimeToExpireString(seconds)
Parameters:
seconds - 


getTurnHtml

String getTurnHtml()

Called when needing the it-is-your-turn game prompts HTML. Override to set. Internally returns either beginTurnHtml, continueTurnHtml or completeTurnHtml.

Overrides:
getTurnHtml in class Game
Returns:
HTML for the game prompts.

getUnitPhrase

getUnitPhrase(num)
Parameters:
num - 


handleMoveCollision

void handleMoveCollision(/*Object*/ gameData,
                         /*Array*/ collisionMoves)

Override to handle move collisions from concurrent turns.

Overrides:
handleMoveCollision in class Game
Parameters:
gameData - 
The most current gameData on the server. This is the state the collision moves must be merged into.
collisionMoves - 
The list of moves that generated the collision.

Example:

handleMoveCollision:function(gameData,collisionMoves)
{
   var lastCollisionMove=collisionMoves[collisionMoves.length-1];
   this.importRawGame(gameData);
   
   //make same moves as lastCollisionMove
   
   this.sendMove();
}

incrementPhase

incrementPhase(commit)
Parameters:
commit - 


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.

isOrderCrazy

isOrderCrazy(order)
Parameters:
order - 


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.

missingRetreatsInLog

missingRetreatsInLog(s1,
                     mp1,
                     s2,
                     mp2)
Parameters:
s1 - 

mp1 - 

s2 - 

mp2 - 


mustTurnInOrdersHtml

mustTurnInOrdersHtml(needToTurnInOrders)
Parameters:
needToTurnInOrders - 


needToTurnInOrders

needToTurnInOrders()

notYourTurnHtml

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

noteOrphanedOrders

noteOrphanedOrders(orders)
Parameters:
orders - 


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.

openJudge

openJudge()

openJudgeAnchorHtml

openJudgeAnchorHtml()

openMapEditor

openMapEditor()

openMapEditorAnchorHtml

openMapEditorAnchorHtml()

orderTableHtml

orderTableHtml(noteOrphaned)
Parameters:
noteOrphaned - 


orderTerritoryDescriptionHtml

orderTerritoryDescriptionHtml(tIndex,
                              cIndex,
                              unitType)
Parameters:
tIndex - 

cIndex - 

unitType - 


orderUnitImageHtml

orderUnitImageHtml(order)
Parameters:
order - 


packGameData

packGameData(gamePhase,
             movePhase,
             orderPhase,
             board,
             orders,
             lastTimeOrdersTurnedIn,
             orderTimeLimit)
Parameters:
gamePhase - 

movePhase - 

orderPhase - 

board - 

orders - 

lastTimeOrdersTurnedIn - 

orderTimeLimit - 


processOrders

processOrders(commit)
Parameters:
commit - 


processOrdersButtonHtml

processOrdersButtonHtml()

processOrdersHtml

processOrdersHtml(justTheTable)
Parameters:
justTheTable - 


processSecureMove

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 Game
Parameters:
game - 
The game object to process.
Returns:
false.

replaceOverriddenOrders

replaceOverriddenOrders(orders,
                        oOrders)
Parameters:
orders - 

oOrders - 


reportOrderImageError

reportOrderImageError(src)
Parameters:
src - 


resetOrdersIfTesting

resetOrdersIfTesting()

resign

void resign()

Resignes the current player. Clears mouse events, sets the player as resigned, and sends the move.

Overrides:
resign in class Game

retreatOrDisbandHtml

retreatOrDisbandHtml()

retreatOrdersMouseDown

retreatOrdersMouseDown(point,
                       event)
Parameters:
point - 

event - 


retreatOrdersMouseMove

retreatOrdersMouseMove(point)
Parameters:
point - 


retreatOrdersMouseUp

retreatOrdersMouseUp(point)
Parameters:
point - 


seasonFromGamePhase

seasonFromGamePhase(gamePhase)
Parameters:
gamePhase - 


sendOrderImageErrors

sendOrderImageErrors()

sendOrderImageErrorsResponse

sendOrderImageErrorsResponse(response)
Parameters:
response - 


setMouseTerritoriesByPoint

setMouseTerritoriesByPoint(point,
                           noRepeats)
Parameters:
point - 

noRepeats - 


setOrdersForNewPhase

setOrdersForNewPhase()

setTurnsForTeamsToGiveOrders

setTurnsForTeamsToGiveOrders()

shortOrderDescriptionHtml

shortOrderDescriptionHtml(order,
                          orders)
Parameters:
order - 

orders - 


showExample

showExample(notation)
Parameters:
notation - 


spectatingHtml

String spectatingHtml()

Called when needing the you-are-spectating game prompts HTML. Override to set. Internally returns the following combined: refreshGameButtonHtml and closeWindowButtonHtml.

Overrides:
spectatingHtml in class Game
Returns:
HTML for the game prompts.

standardExamplesHtml

standardExamplesHtml()

submitDefaultOrders

submitDefaultOrders()

submitDefaultOrdersButtonHtml

submitDefaultOrdersButtonHtml()

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.

teamColorFromTeam

Number teamColorFromTeam(/*Team*/ team)

Gets the team color.

Overrides:
teamColorFromTeam in class Game
Parameters:
team - 
The team to get the color of.
Returns:
The team color.

testOrderImageFor404

testOrderImageFor404(e)
Parameters:
e - 


testingOrdersHtml

testingOrdersHtml()

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.

turnInOrders

turnInOrders(emptyOrders,
             forced)
Parameters:
emptyOrders - 

forced - 


turnInOrdersButtonHtml

turnInOrdersButtonHtml(newOrdersToTurnIn)
Parameters:
newOrdersToTurnIn - 


turnInOrdersOnClick

turnInOrdersOnClick()

undoAnchorHtml

undoAnchorHtml()

unitImageHtml

unitImageHtml(color,
              unitType)
Parameters:
color - 

unitType - 


unpackGameData

unpackGameData(data)
Parameters:
data - 


updateExpirePhrase

updateExpirePhrase()

updateOrderImages

updateOrderImages(overrideOrders)
Parameters:
overrideOrders - 


waitingForOrders

waitingForOrders()

weHaveDisolves

weHaveDisolves()

weHaveDisolvesOrBuilds

weHaveDisolvesOrBuilds()

weHaveUnits

weHaveUnits(dislodged)
Parameters:
dislodged - 


whoAreWeWaitingOnHtml

whoAreWeWaitingOnHtml()

writeOrdersHtml

writeOrdersHtml()

yearFromGamePhase

yearFromGamePhase(gamePhase)
Parameters:
gamePhase -