File: Games\Viktory2\Game.js

GamesByEmail
Class Viktory2Piece

Object
  
 
 
GamesByEmail.Piece
 
 
GamesByEmail.Viktory2Piece

All Implemented Interfaces:

Class


GamesByEmail.Viktory2Piece

extends Piece

Constructor Summary
GamesByEmail.Viktory2Piece(/*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
 addPennantIfNeeded(color, rulerColor, update, override)
 addUnit(color, type)
 addUnitCounts(counts, color)
 allAdjacentsVisible()
 allowsRelocation(color, rulerColor)
 anyBombardersLeft(color)
 anyMoversLeft(color)
StringBuilderappendHtml(/*StringBuilder*/ htmlBuilder)
Adds the pieces HTML to the a string builder. #returns The string builder after appending.
 areRemainingMilitaryUnitsHomogeneous(unitList)
 attackerUnitClicked(unit)
 battleCompleteLogEntry(color)
 battleOkClick(color, start)
 battleUnitClicked(unitIndex, attacker)
 bombardOkClick(color)
 canBeAttackedBy(color, rulerColor, bypassPennants)
voidcenter(/*Point*/ screenPoint, /*Boolean*/ noConstrain)
Centers the piece on a point.
 centerUnload(unitType, color, screenPoint)
 clearUnitRelocating()
 collectRetreatIndices(color)
 conquer(color, update)
 countHitUnitsForLogEntry(unitType, color, enemy)
 countHits(rolls, hitThreshold)
 countMilitaryUnits(unitList)
 countNumHit(color)
 countNumOptionalHit(color)
 countOpponentMilitary(color)
 countRollingUnits(color)
 countTacticalHits(rolls)
 darkOrAdjacentDark()
 debug()
 defenderUnitClicked(unit)
 dispose()
 findAdjacentEnemyUnit(color, rulerColor)
 findArtillery(color)
 findCapital(color)
 findCavalry(color)
 findCivilization(color)
 findDoomsdayClock(color)
 findFrigate(color)
 findInfantry(color)
 findLeastNeededCargo(color, cargoType, cargoExpendability)
 findLeastNeededUnit(color, unitType, cargoExpendability)
 findMilitary(color)
 findOpponent(color)
 findOpponentCapital(color)
 findOpponentCivilization(color)
 findOpponentMilitary(color)
 findOpponentPennant(color)
 findOpponentUnit(color, unitType)
 findPennant(color)
 findSubjugationFlag(color)
 findTown(color)
 findUnit(color, unitType)
 forfeitPendingBattle(color)
 getAdjacentIndecies(radius)
 getArtilleryUnitList(color)
 getAttackerHitPromts()
 getBattleBoxDividerHtml()
 getBattleContainerStyle()
 getBattleHtml(color, round, attackerRolls, defenderRolls, retreats)
 getBattleInfo(unitList, rolls, hitThreshold, tacticalInput)
 getBattleRolls(num, asAttacker)
 getBattleRoundHtml(attackerColor, attackerRolls, defenderRolls)
 getBattleStyle(needBorder, unit)
 getBombardHtml(attackerColor, attackerRolls)
RectanglegetClipRect()
Gets the clipping rectangle for this piece based on its color value. #returns The clipping rectangle.
 getCommitToContinueBattleHtml(attackerColor, start)
 getCommitToPreBattleArtilleryFireHtml(attackerColor)
 getCommitToStartBattleHtml(attackerColor)
 getCommitToStartReserveBattleHtml(attackerColor)
 getDefenderHitPromts(hits, tacticalHits)
 getDefenderUnitList(color)
 getDiceHtml(rolls, hitThreshold)
 getHighestHitUnit(color)
 getHiliteClipRect(border)
 getHitCountsForLogEntry(color, enemy)
 getHitEvent(needEvent, unit, areAttackers)
 getHitUnitsLogEntries(color)
 getLandRetreatables(color)
 getLowestOptionalHitUnit(color)
 getMemoryUnitsHtml(pieceCenter, src)
 getMilitaryUnitCount(color)
 getMilitaryUnitHitValueList(unitList, numHits)
 getMilitaryUnitList(color)
 getNextOptionalHit(color)
 getNumAttackingHexes(color)
 getOkButtonPrompts(method, attackerColor)
 getOpponentColor(color)
 getPreBattleArtilleryFireHtml(attackerColor, attackerRolls, defenderRolls)
 getRetreatables(color)
 getRoadsOut(color, rulerColor, allowance)
 getRolls(attackerColor, numSetsToAverage)
 getRotatedBoardValue()
 getScore(color)
RectanglegetScreenRect(/*String*/ boardPoint)
Gets the screen rectangle for this piece based on its boardPoint property.
 getSubjugatorRetreatables()
 getTileIndexColors()
 getUnitImageSrc()
 getUnitListHtml(unitList, areAttackers, needBorder, needEvent, showAttackHexes)
 getUnitValue()
 getUnitsListHtml(unitType, pieceCenter, src)
 getUnknownRolls(num)
 getWaterRetreatables(color)
 hasAdjacentRollingEnemy(color, rulerColor)
 hasAllianceCivilization(color, rulerColor)
 hasAlliedCity(color, rulerColor)
 hasAlliedMilitary(color, rulerColor)
 hasAlliedUnit(color, rulerColor)
 hasArtillery(color)
 hasBattle(color, rulerColor)
 hasCapital(color)
 hasCavalry(color)
 hasCity(color)
 hasCivilization(color)
 hasDoomsdayClock(color)
 hasEnemy(color, rulerColor)
 hasFrigate(color)
 hasInfantry(color)
 hasLoadableUnit(color, forRetreat)
 hasMetropolis(color)
 hasMilitary(color)
 hasNavalSupport(color)
 hasNonRulingOpponentMilitary(color, rulerColor)
 hasOpponent(color)
 hasOpponentAllianceUnits(color, rulerColor)
 hasOpponentArtillery(color)
 hasOpponentCapital(color)
 hasOpponentCapital(color)
 hasOpponentCity(color)
 hasOpponentCivilization(color)
 hasOpponentMetropolis(color)
 hasOpponentPennant(color)
 hasOpponentTown(color)
 hasOpponentUnit(color, unitType)
 hasPennant(color)
 hasPreBattle(color)
 hasRelocatingCivilization(color)
 hasRollingEnemy(color, rulerColor)
 hasRollingOpponent(color)
 hasSubjugationFlag(color)
 hasTown(color)
 hasUnit(color, unitType)
 hasUnitAsCargo(color, unitType)
 hasUnitToBombard(color, rulerColor)
 hasUnloadableAdjacents(color)
 hitAllMilitaryUnits(unitList, optional)
 hitHighestMilitaryUnits(unitList, numToHit, optional)
 hitLowestMilitaryUnits(unitList, numToHit, optional)
 hitUnitsByIndices(unitList, indices, optional)
 isBeingRevealed()
 isBlockingTerrain()
 isBuildable(color, rulerColor)
 isForest()
 isGrassland()
 isLand()
 isMountain()
 isPerimeter()
 isPlain()
 isPort(color)
 isRelocatable(color, rulerColor, oldPoint)
 isRoadable(color, rulerColor)
 isSlowTerrain(color, rulerColor)
 isUnloadable(color)
 isWater()
 luckAverageAttacker(attackerHitThreshold, attackerRolls, numSetsToAverage)
 luckAverageRolls(hitThreshold, rolls, startIndex, numSets)
 maybeLuckAverageDefender(defenderHitThreshold, defenderRolls, defenderColor)
 maybeStartDoomsdayClock(civ)
 maybeSuppressDefender(defenderRolls, defenderColor, overkill)
 militaryUnitFromScreenPoint(screenPoint, unitType, color, rulerColor, movers, bombarders, loadables, retreatables, cargoType, redeployables)
 minDistanceTo(piece, max, mustBeVisible, forRoad, color, rulerColor)
 minDistanceToR(distance, leastPossible, piece, max, mustBeVisible, forRoad, color, rulerColor)
 moveUnit(unit)
 numAttackerRolls(color)
 numDefenderMilitaryRolls(opponentColor)
 numDefenderRolls(opponentColor)
 populateMilitaryUnitHitValueList(unitList, hitList, indexList, startIndex, numHits)
 preBattleOkClick(color)
 pushBombardable(bombardables, color, rulerColor)
 pushMoveable(movables, color, rulerColor, distance, retreatIndex)
 remainingUnhitValue(unitList)
 removeAllUnits(update)
 removeHitUnits()
 removeOpponentPennants(color, update)
 removePennant(color, update)
 removePennantsInEnemyLand(color, enemyColor)
 removeUnit(unit, orphanedPennantToo)
 removeUnitAtIndex(index)
 resetTurnAttributes(color)
 setActiveUnit(unit)
 setAllMilitaryMoveComplete(color, update)
 setAllianceColorBlind(color)
 setBattleOkButtonState()
 setBorder(borderOn)
 setHilite(hiliteOn)
 setMovingUnit(unit)
 setSubjugation(color, rulerColor, update)
 setUndark()
 setUnitHit(unit, hit, optional)
 setUnitValue(value)
voidsetVisibility(/*Boolean*/ hidden)
Sets the 'temporary' visibility of a piece.
voidsnap(/*Point*/ boardPoint, /*String*/ boardValueOverride)
Centers the piece on a board point. The boardPoint property is not altered.
 sortUnitList(unitList)
 subjugate(color)
 terrainDefenses()
 terrianMatchesUnitType(unitType)
 unhitAllUnoptionalHits(color)
 unhitLowestOptionalHit(color)
 updateUnitDisplay()
 updateUnitHitDisplay(unit)
 upgradeTownToCity()
 urbanDefenses(color)
 whackAllUnits(color, unitType)
 willSubjugate(color)

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

Methods inherited from Foundation.Class
getTypePath, isInstanceOf

Constructor Detail

Viktory2Piece

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

addPennantIfNeeded

addPennantIfNeeded(color,
                   rulerColor,
                   update,
                   override)
Parameters:
color - 

rulerColor - 

update - 

override - 


addUnit

addUnit(color,
        type)
Parameters:
color - 

type - 


addUnitCounts

addUnitCounts(counts,
              color)
Parameters:
counts - 

color - 


allAdjacentsVisible

allAdjacentsVisible()

allowsRelocation

allowsRelocation(color,
                 rulerColor)
Parameters:
color - 

rulerColor - 


anyBombardersLeft

anyBombardersLeft(color)
Parameters:
color - 


anyMoversLeft

anyMoversLeft(color)
Parameters:
color - 


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.

areRemainingMilitaryUnitsHomogeneous

areRemainingMilitaryUnitsHomogeneous(unitList)
Parameters:
unitList - 


attackerUnitClicked

attackerUnitClicked(unit)
Parameters:
unit - 


battleCompleteLogEntry

battleCompleteLogEntry(color)
Parameters:
color - 


battleOkClick

battleOkClick(color,
              start)
Parameters:
color - 

start - 


battleUnitClicked

battleUnitClicked(unitIndex,
                  attacker)
Parameters:
unitIndex - 

attacker - 


bombardOkClick

bombardOkClick(color)
Parameters:
color - 


canBeAttackedBy

canBeAttackedBy(color,
                rulerColor,
                bypassPennants)
Parameters:
color - 

rulerColor - 

bypassPennants - 


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.

centerUnload

centerUnload(unitType,
             color,
             screenPoint)
Parameters:
unitType - 

color - 

screenPoint - 


clearUnitRelocating

clearUnitRelocating()

collectRetreatIndices

collectRetreatIndices(color)
Parameters:
color - 


conquer

conquer(color,
        update)
Parameters:
color - 

update - 


countHitUnitsForLogEntry

countHitUnitsForLogEntry(unitType,
                         color,
                         enemy)
Parameters:
unitType - 

color - 

enemy - 


countHits

countHits(rolls,
          hitThreshold)
Parameters:
rolls - 

hitThreshold - 


countMilitaryUnits

countMilitaryUnits(unitList)
Parameters:
unitList - 


countNumHit

countNumHit(color)
Parameters:
color - 


countNumOptionalHit

countNumOptionalHit(color)
Parameters:
color - 


countOpponentMilitary

countOpponentMilitary(color)
Parameters:
color - 


countRollingUnits

countRollingUnits(color)
Parameters:
color - 


countTacticalHits

countTacticalHits(rolls)
Parameters:
rolls - 


darkOrAdjacentDark

darkOrAdjacentDark()

debug

debug()

defenderUnitClicked

defenderUnitClicked(unit)
Parameters:
unit - 


dispose

dispose()
Overrides:
dispose in class Piece

findAdjacentEnemyUnit

findAdjacentEnemyUnit(color,
                      rulerColor)
Parameters:
color - 

rulerColor - 


findArtillery

findArtillery(color)
Parameters:
color - 


findCapital

findCapital(color)
Parameters:
color - 


findCavalry

findCavalry(color)
Parameters:
color - 


findCivilization

findCivilization(color)
Parameters:
color - 


findDoomsdayClock

findDoomsdayClock(color)
Parameters:
color - 


findFrigate

findFrigate(color)
Parameters:
color - 


findInfantry

findInfantry(color)
Parameters:
color - 


findLeastNeededCargo

findLeastNeededCargo(color,
                     cargoType,
                     cargoExpendability)
Parameters:
color - 

cargoType - 

cargoExpendability - 


findLeastNeededUnit

findLeastNeededUnit(color,
                    unitType,
                    cargoExpendability)
Parameters:
color - 

unitType - 

cargoExpendability - 


findMilitary

findMilitary(color)
Parameters:
color - 


findOpponent

findOpponent(color)
Parameters:
color - 


findOpponentCapital

findOpponentCapital(color)
Parameters:
color - 


findOpponentCivilization

findOpponentCivilization(color)
Parameters:
color - 


findOpponentMilitary

findOpponentMilitary(color)
Parameters:
color - 


findOpponentPennant

findOpponentPennant(color)
Parameters:
color - 


findOpponentUnit

findOpponentUnit(color,
                 unitType)
Parameters:
color - 

unitType - 


findPennant

findPennant(color)
Parameters:
color - 


findSubjugationFlag

findSubjugationFlag(color)
Parameters:
color - 


findTown

findTown(color)
Parameters:
color - 


findUnit

findUnit(color,
         unitType)
Parameters:
color - 

unitType - 


forfeitPendingBattle

forfeitPendingBattle(color)
Parameters:
color - 


getAdjacentIndecies

getAdjacentIndecies(radius)
Parameters:
radius - 


getArtilleryUnitList

getArtilleryUnitList(color)
Parameters:
color - 


getAttackerHitPromts

getAttackerHitPromts()

getBattleBoxDividerHtml

getBattleBoxDividerHtml()

getBattleContainerStyle

getBattleContainerStyle()

getBattleHtml

getBattleHtml(color,
              round,
              attackerRolls,
              defenderRolls,
              retreats)
Parameters:
color - 

round - 

attackerRolls - 

defenderRolls - 

retreats - 


getBattleInfo

getBattleInfo(unitList,
              rolls,
              hitThreshold,
              tacticalInput)
Parameters:
unitList - 

rolls - 

hitThreshold - 

tacticalInput - 


getBattleRolls

getBattleRolls(num,
               asAttacker)
Parameters:
num - 

asAttacker - 


getBattleRoundHtml

getBattleRoundHtml(attackerColor,
                   attackerRolls,
                   defenderRolls)
Parameters:
attackerColor - 

attackerRolls - 

defenderRolls - 


getBattleStyle

getBattleStyle(needBorder,
               unit)
Parameters:
needBorder - 

unit - 


getBombardHtml

getBombardHtml(attackerColor,
               attackerRolls)
Parameters:
attackerColor - 

attackerRolls - 


getClipRect

Rectangle getClipRect()

Gets the clipping rectangle for this piece based on its color value. #returns The clipping rectangle.

Overrides:
getClipRect in class Piece

getCommitToContinueBattleHtml

getCommitToContinueBattleHtml(attackerColor,
                              start)
Parameters:
attackerColor - 

start - 


getCommitToPreBattleArtilleryFireHtml

getCommitToPreBattleArtilleryFireHtml(attackerColor)
Parameters:
attackerColor - 


getCommitToStartBattleHtml

getCommitToStartBattleHtml(attackerColor)
Parameters:
attackerColor - 


getCommitToStartReserveBattleHtml

getCommitToStartReserveBattleHtml(attackerColor)
Parameters:
attackerColor - 


getDefenderHitPromts

getDefenderHitPromts(hits,
                     tacticalHits)
Parameters:
hits - 

tacticalHits - 


getDefenderUnitList

getDefenderUnitList(color)
Parameters:
color - 


getDiceHtml

getDiceHtml(rolls,
            hitThreshold)
Parameters:
rolls - 

hitThreshold - 


getHighestHitUnit

getHighestHitUnit(color)
Parameters:
color - 


getHiliteClipRect

getHiliteClipRect(border)
Parameters:
border - 


getHitCountsForLogEntry

getHitCountsForLogEntry(color,
                        enemy)
Parameters:
color - 

enemy - 


getHitEvent

getHitEvent(needEvent,
            unit,
            areAttackers)
Parameters:
needEvent - 

unit - 

areAttackers - 


getHitUnitsLogEntries

getHitUnitsLogEntries(color)
Parameters:
color - 


getLandRetreatables

getLandRetreatables(color)
Parameters:
color - 


getLowestOptionalHitUnit

getLowestOptionalHitUnit(color)
Parameters:
color - 


getMemoryUnitsHtml

getMemoryUnitsHtml(pieceCenter,
                   src)
Parameters:
pieceCenter - 

src - 


getMilitaryUnitCount

getMilitaryUnitCount(color)
Parameters:
color - 


getMilitaryUnitHitValueList

getMilitaryUnitHitValueList(unitList,
                            numHits)
Parameters:
unitList - 

numHits - 


getMilitaryUnitList

getMilitaryUnitList(color)
Parameters:
color - 


getNextOptionalHit

getNextOptionalHit(color)
Parameters:
color - 


getNumAttackingHexes

getNumAttackingHexes(color)
Parameters:
color - 


getOkButtonPrompts

getOkButtonPrompts(method,
                   attackerColor)
Parameters:
method - 

attackerColor - 


getOpponentColor

getOpponentColor(color)
Parameters:
color - 


getPreBattleArtilleryFireHtml

getPreBattleArtilleryFireHtml(attackerColor,
                              attackerRolls,
                              defenderRolls)
Parameters:
attackerColor - 

attackerRolls - 

defenderRolls - 


getRetreatables

getRetreatables(color)
Parameters:
color - 


getRoadsOut

getRoadsOut(color,
            rulerColor,
            allowance)
Parameters:
color - 

rulerColor - 

allowance - 


getRolls

getRolls(attackerColor,
         numSetsToAverage)
Parameters:
attackerColor - 

numSetsToAverage - 


getRotatedBoardValue

getRotatedBoardValue()

getScore

getScore(color)
Parameters:
color - 


getScreenRect

Rectangle getScreenRect(/*String*/ boardPoint)

Gets the screen rectangle for this piece based on its boardPoint property.

Overrides:
getScreenRect in class Piece
Parameters:
boardPoint - 
(Optional) If provided, calculates with this value instead of its internal boardPoint property.

getSubjugatorRetreatables

getSubjugatorRetreatables()

getTileIndexColors

getTileIndexColors()

getUnitImageSrc

getUnitImageSrc()

getUnitListHtml

getUnitListHtml(unitList,
                areAttackers,
                needBorder,
                needEvent,
                showAttackHexes)
Parameters:
unitList - 

areAttackers - 

needBorder - 

needEvent - 

showAttackHexes - 


getUnitValue

getUnitValue()

getUnitsListHtml

getUnitsListHtml(unitType,
                 pieceCenter,
                 src)
Parameters:
unitType - 

pieceCenter - 

src - 


getUnknownRolls

getUnknownRolls(num)
Parameters:
num - 


getWaterRetreatables

getWaterRetreatables(color)
Parameters:
color - 


hasAdjacentRollingEnemy

hasAdjacentRollingEnemy(color,
                        rulerColor)
Parameters:
color - 

rulerColor - 


hasAllianceCivilization

hasAllianceCivilization(color,
                        rulerColor)
Parameters:
color - 

rulerColor - 


hasAlliedCity

hasAlliedCity(color,
              rulerColor)
Parameters:
color - 

rulerColor - 


hasAlliedMilitary

hasAlliedMilitary(color,
                  rulerColor)
Parameters:
color - 

rulerColor - 


hasAlliedUnit

hasAlliedUnit(color,
              rulerColor)
Parameters:
color - 

rulerColor - 


hasArtillery

hasArtillery(color)
Parameters:
color - 


hasBattle

hasBattle(color,
          rulerColor)
Parameters:
color - 

rulerColor - 


hasCapital

hasCapital(color)
Parameters:
color - 


hasCavalry

hasCavalry(color)
Parameters:
color - 


hasCity

hasCity(color)
Parameters:
color - 


hasCivilization

hasCivilization(color)
Parameters:
color - 


hasDoomsdayClock

hasDoomsdayClock(color)
Parameters:
color - 


hasEnemy

hasEnemy(color,
         rulerColor)
Parameters:
color - 

rulerColor - 


hasFrigate

hasFrigate(color)
Parameters:
color - 


hasInfantry

hasInfantry(color)
Parameters:
color - 


hasLoadableUnit

hasLoadableUnit(color,
                forRetreat)
Parameters:
color - 

forRetreat - 


hasMetropolis

hasMetropolis(color)
Parameters:
color - 


hasMilitary

hasMilitary(color)
Parameters:
color - 


hasNavalSupport

hasNavalSupport(color)
Parameters:
color - 


hasNonRulingOpponentMilitary

hasNonRulingOpponentMilitary(color,
                             rulerColor)
Parameters:
color - 

rulerColor - 


hasOpponent

hasOpponent(color)
Parameters:
color - 


hasOpponentAllianceUnits

hasOpponentAllianceUnits(color,
                         rulerColor)
Parameters:
color - 

rulerColor - 


hasOpponentArtillery

hasOpponentArtillery(color)
Parameters:
color - 


hasOpponentCapital

hasOpponentCapital(color)
Parameters:
color - 


hasOpponentCapital

hasOpponentCapital(color)
Parameters:
color - 


hasOpponentCity

hasOpponentCity(color)
Parameters:
color - 


hasOpponentCivilization

hasOpponentCivilization(color)
Parameters:
color - 


hasOpponentMetropolis

hasOpponentMetropolis(color)
Parameters:
color - 


hasOpponentPennant

hasOpponentPennant(color)
Parameters:
color - 


hasOpponentTown

hasOpponentTown(color)
Parameters:
color - 


hasOpponentUnit

hasOpponentUnit(color,
                unitType)
Parameters:
color - 

unitType - 


hasPennant

hasPennant(color)
Parameters:
color - 


hasPreBattle

hasPreBattle(color)
Parameters:
color - 


hasRelocatingCivilization

hasRelocatingCivilization(color)
Parameters:
color - 


hasRollingEnemy

hasRollingEnemy(color,
                rulerColor)
Parameters:
color - 

rulerColor - 


hasRollingOpponent

hasRollingOpponent(color)
Parameters:
color - 


hasSubjugationFlag

hasSubjugationFlag(color)
Parameters:
color - 


hasTown

hasTown(color)
Parameters:
color - 


hasUnit

hasUnit(color,
        unitType)
Parameters:
color - 

unitType - 


hasUnitAsCargo

hasUnitAsCargo(color,
               unitType)
Parameters:
color - 

unitType - 


hasUnitToBombard

hasUnitToBombard(color,
                 rulerColor)
Parameters:
color - 

rulerColor - 


hasUnloadableAdjacents

hasUnloadableAdjacents(color)
Parameters:
color - 


hitAllMilitaryUnits

hitAllMilitaryUnits(unitList,
                    optional)
Parameters:
unitList - 

optional - 


hitHighestMilitaryUnits

hitHighestMilitaryUnits(unitList,
                        numToHit,
                        optional)
Parameters:
unitList - 

numToHit - 

optional - 


hitLowestMilitaryUnits

hitLowestMilitaryUnits(unitList,
                       numToHit,
                       optional)
Parameters:
unitList - 

numToHit - 

optional - 


hitUnitsByIndices

hitUnitsByIndices(unitList,
                  indices,
                  optional)
Parameters:
unitList - 

indices - 

optional - 


isBeingRevealed

isBeingRevealed()

isBlockingTerrain

isBlockingTerrain()

isBuildable

isBuildable(color,
            rulerColor)
Parameters:
color - 

rulerColor - 


isForest

isForest()

isGrassland

isGrassland()

isLand

isLand()

isMountain

isMountain()

isPerimeter

isPerimeter()

isPlain

isPlain()

isPort

isPort(color)
Parameters:
color - 


isRelocatable

isRelocatable(color,
              rulerColor,
              oldPoint)
Parameters:
color - 

rulerColor - 

oldPoint - 


isRoadable

isRoadable(color,
           rulerColor)
Parameters:
color - 

rulerColor - 


isSlowTerrain

isSlowTerrain(color,
              rulerColor)
Parameters:
color - 

rulerColor - 


isUnloadable

isUnloadable(color)
Parameters:
color - 


isWater

isWater()

luckAverageAttacker

luckAverageAttacker(attackerHitThreshold,
                    attackerRolls,
                    numSetsToAverage)
Parameters:
attackerHitThreshold - 

attackerRolls - 

numSetsToAverage - 


luckAverageRolls

luckAverageRolls(hitThreshold,
                 rolls,
                 startIndex,
                 numSets)
Parameters:
hitThreshold - 

rolls - 

startIndex - 

numSets - 


maybeLuckAverageDefender

maybeLuckAverageDefender(defenderHitThreshold,
                         defenderRolls,
                         defenderColor)
Parameters:
defenderHitThreshold - 

defenderRolls - 

defenderColor - 


maybeStartDoomsdayClock

maybeStartDoomsdayClock(civ)
Parameters:
civ - 


maybeSuppressDefender

maybeSuppressDefender(defenderRolls,
                      defenderColor,
                      overkill)
Parameters:
defenderRolls - 

defenderColor - 

overkill - 


militaryUnitFromScreenPoint

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

unitType - 

color - 

rulerColor - 

movers - 

bombarders - 

loadables - 

retreatables - 

cargoType - 

redeployables - 


minDistanceTo

minDistanceTo(piece,
              max,
              mustBeVisible,
              forRoad,
              color,
              rulerColor)
Parameters:
piece - 

max - 

mustBeVisible - 

forRoad - 

color - 

rulerColor - 


minDistanceToR

minDistanceToR(distance,
               leastPossible,
               piece,
               max,
               mustBeVisible,
               forRoad,
               color,
               rulerColor)
Parameters:
distance - 

leastPossible - 

piece - 

max - 

mustBeVisible - 

forRoad - 

color - 

rulerColor - 


moveUnit

moveUnit(unit)
Parameters:
unit - 


numAttackerRolls

numAttackerRolls(color)
Parameters:
color - 


numDefenderMilitaryRolls

numDefenderMilitaryRolls(opponentColor)
Parameters:
opponentColor - 


numDefenderRolls

numDefenderRolls(opponentColor)
Parameters:
opponentColor - 


populateMilitaryUnitHitValueList

populateMilitaryUnitHitValueList(unitList,
                                 hitList,
                                 indexList,
                                 startIndex,
                                 numHits)
Parameters:
unitList - 

hitList - 

indexList - 

startIndex - 

numHits - 


preBattleOkClick

preBattleOkClick(color)
Parameters:
color - 


pushBombardable

pushBombardable(bombardables,
                color,
                rulerColor)
Parameters:
bombardables - 

color - 

rulerColor - 


pushMoveable

pushMoveable(movables,
             color,
             rulerColor,
             distance,
             retreatIndex)
Parameters:
movables - 

color - 

rulerColor - 

distance - 

retreatIndex - 


remainingUnhitValue

remainingUnhitValue(unitList)
Parameters:
unitList - 


removeAllUnits

removeAllUnits(update)
Parameters:
update - 


removeHitUnits

removeHitUnits()

removeOpponentPennants

removeOpponentPennants(color,
                       update)
Parameters:
color - 

update - 


removePennant

removePennant(color,
              update)
Parameters:
color - 

update - 


removePennantsInEnemyLand

removePennantsInEnemyLand(color,
                          enemyColor)
Parameters:
color - 

enemyColor - 


removeUnit

removeUnit(unit,
           orphanedPennantToo)
Parameters:
unit - 

orphanedPennantToo - 


removeUnitAtIndex

removeUnitAtIndex(index)
Parameters:
index - 


resetTurnAttributes

resetTurnAttributes(color)
Parameters:
color - 


setActiveUnit

setActiveUnit(unit)
Parameters:
unit - 


setAllMilitaryMoveComplete

setAllMilitaryMoveComplete(color,
                           update)
Parameters:
color - 

update - 


setAllianceColorBlind

setAllianceColorBlind(color)
Parameters:
color - 


setBattleOkButtonState

setBattleOkButtonState()

setBorder

setBorder(borderOn)
Parameters:
borderOn - 


setHilite

setHilite(hiliteOn)
Parameters:
hiliteOn - 


setMovingUnit

setMovingUnit(unit)
Parameters:
unit - 


setSubjugation

setSubjugation(color,
               rulerColor,
               update)
Parameters:
color - 

rulerColor - 

update - 


setUndark

setUndark()

setUnitHit

setUnitHit(unit,
           hit,
           optional)
Parameters:
unit - 

hit - 

optional - 


setUnitValue

setUnitValue(value)
Parameters:
value - 


setVisibility

void setVisibility(/*Boolean*/ hidden)

Sets the 'temporary' visibility of a piece.

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

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.

sortUnitList

sortUnitList(unitList)
Parameters:
unitList - 


subjugate

subjugate(color)
Parameters:
color - 


terrainDefenses

terrainDefenses()

terrianMatchesUnitType

terrianMatchesUnitType(unitType)
Parameters:
unitType - 


unhitAllUnoptionalHits

unhitAllUnoptionalHits(color)
Parameters:
color - 


unhitLowestOptionalHit

unhitLowestOptionalHit(color)
Parameters:
color - 


updateUnitDisplay

updateUnitDisplay()

updateUnitHitDisplay

updateUnitHitDisplay(unit)
Parameters:
unit - 


upgradeTownToCity

upgradeTownToCity()

urbanDefenses

urbanDefenses(color)
Parameters:
color - 


whackAllUnits

whackAllUnits(color,
              unitType)
Parameters:
color - 

unitType - 


willSubjugate

willSubjugate(color)
Parameters:
color -