Class Index | File Index

Classes


Class CombatCalculator

CombatCalculator
Defined in: combatCalculator.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
CombatCalculator(Wargame, Force, Terrain, Map)
CombatCalculator
Method Summary
Method Attributes Method Name and Description
 
method to check if all attackers are attacking across river
 
applyCRTresults(defenderIndex, combatResults, dieRoll)
method to apply CRT results
 
method to apply phase change rules
 
getArrayOfAttackers(combatNumber, forceName)
method to get array of attackers
 
getArrayOfCombatants(combatNumber, forceName)
method to get array of combatants
 
getArrayOfDefenders(combatNumber, forceName)
method to get array of defenders
 
method to get combat odds info
 
getTotalAttackerStrength(combatNumber, forceName)
method to get total attacker strength
 
getTotalDefenderStrength(combatNumber, forceName)
method to get total defender strength
 
method to check if over half are attacking across river
 
removeCombatListItem(attackerIndex, defenderIndex)
method to remove a combat list item
 
setCombatIndex(defenderIndex)
method to set unit's combat index
 
setupCombatHexside(gridPoint)
method to set combat using hexside between attacker and defender
 
method to check if some are attacking across river
 
method to undo attacker setup
 
method to undo defender setup
 
method to check if unit can attack
 
method to check if unit is flanked
Class Detail
CombatCalculator(Wargame, Force, Terrain, Map)
CombatCalculator
Parameters:
Wargame
{object}
Force
{object}
Terrain
{object}
Map
{object}
Method Detail
{boolean} allAreAttackingAcrossRiver(defenderIndex)
method to check if all attackers are attacking across river
Parameters:
defenderIndex
{integer} The defending unit index
Returns:
{boolean} allAttackingAcrossRiver

applyCRTresults(defenderIndex, combatResults, dieRoll)
method to apply CRT results
Parameters:
defenderIndex
{integer} The defending unit index
combatResults
{string} combat Results
dieRoll
{integer} The die roll

applyPhaseChangeRules()
method to apply phase change rules

{array} getArrayOfAttackers(combatNumber, forceName)
method to get array of attackers
Parameters:
combatNumber
{integer} combat Number
forceName
{string} force Name
Returns:
{array} attacker Array

{array} getArrayOfCombatants(combatNumber, forceName)
method to get array of combatants
Parameters:
combatNumber
{integer} combat Number
forceName
{string} force Name
Returns:
{array} combatants Array

{array} getArrayOfDefenders(combatNumber, forceName)
method to get array of defenders
Parameters:
combatNumber
{integer} combat Number
forceName
{string} force Name
Returns:
{array} defenders Array

{string} getCombatOddsInfo(index)
method to get combat odds info
Parameters:
index
{integer} unit index
Returns:
{string} info

{integer} getTotalAttackerStrength(combatNumber, forceName)
method to get total attacker strength
Parameters:
combatNumber
{integer} combat Number
forceName
{string} force Name
Returns:
{integer} attackerStrength

{integer} getTotalDefenderStrength(combatNumber, forceName)
method to get total defender strength
Parameters:
combatNumber
{integer} combat Number
forceName
{string} force Name
Returns:
{integer} defenderStrength

{boolean} overHalfAreAttackingAcrossRiver(defenderIndex)
method to check if over half are attacking across river
Parameters:
defenderIndex
{integer} unit index
Returns:
{boolean} overHalcombatCalculatorfAreAttacking

removeCombatListItem(attackerIndex, defenderIndex)
method to remove a combat list item
Parameters:
attackerIndex
{integer} unit index
defenderIndex
{integer} unit index

setCombatIndex(defenderIndex)
method to set unit's combat index
Parameters:
defenderIndex
{integer} unit index

setupCombatHexside(gridPoint)
method to set combat using hexside between attacker and defender
Parameters:
gridPoint
{point} grid point

{boolean} someAreAttackingAcrossRiver(defenderIndex)
method to check if some are attacking across river
Parameters:
defenderIndex
{integer} unit index
Returns:
{boolean} someAttackingAcrossRiver

undoAttackerSetup(index)
method to undo attacker setup
Parameters:
index
{integer} unit index

undoDefenderSetup(index)
method to undo defender setup
Parameters:
index
{integer} unit index

{boolean} unitCanAttack(index)
method to check if unit can attack
Parameters:
index
{integer} unit index
Returns:
{boolean} canAttack

{boolean} unitIsFlanked(index)
method to check if unit is flanked
Parameters:
index
{integer} unit index
Returns:
{boolean} isFlanked

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Oct 22 2018 09:30:16 GMT-0700 (PDT)