Class Index | File Index

Classes


Class MoveCalculator

MoveCalculator
Defined in: moveCalculator.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
MoveCalculator(Wargame, Force, Terrain, Map)
MoveCalculator
Method Summary
Method Attributes Method Name and Description
 
addToRetreatHexagonList(index, hexagonPoint)
method to add unit to retreat hexagon list
 
advanceIsValid(index, hexagonPoint)
method to check if advance Is Valid
 
method to apply phase change rules
 
calculateMoveCost(index, startHexagonPoint, endHexagonPoint)
method to calculate move cost
 
calculateReinforceMoveCost(index, hexagonPoint)
method to calculate reinforce cost
 
method to clear retreat hexagon list
 
method to eliminate unit
 
getEntranceMoveCost(index, hexagonPoint)
method to get entrance cost
 
getMoveInfo(index)
method to get move info
 
method to see if move is across a river without using a bridge
 
moveIsInRange(index, startHexagonPoint, endHexagonPoint)
method to see if move is in range
 
moveIsTraverse(startHexagonPoint, endHexagonPoint, attribute)
method to see if move is traversing over terrain type
 
moveIsValid(index, endHexagonPoint)
method to see if move is valid
 
method to see if move over enemy allowed
 
method to see if move over run allowed
 
moveWillCauseStop(index, endHexagonPoint)
method to see if move will cause stop
 
method to see if retreat is blocked
 
retreatIsBlockedtoHexagonPoint(index, endHexagonPoint)
method to see if retreat is blocked at hexagon point
 
retreatIsValid(index, endHexagonPoint)
method to see if retreat is valid
 
terrainIsProhibited(index, startHexagonPoint, endHexagonPoint)
method to see if terrain is prohibited
 
unitCanExit(index, hexagonPoint)
method to see if unit can exit
 
unitCanStart(index)
method to see if unit can start
 
unitHasMoveAmountAvailable(index, moveAmount, moveAmountUsed)
method to see if unit has move amount
 
unitWillUseMaxMove(index, moveAmount, moveAmountUsed)
method to see if unit will use move amount
Class Detail
MoveCalculator(Wargame, Force, Terrain, Map)
MoveCalculator
Parameters:
Wargame
{object}
Force
{object}
Terrain
{object}
Map
{object}
Method Detail
addToRetreatHexagonList(index, hexagonPoint)
method to add unit to retreat hexagon list
Parameters:
index
{integer} The unit index in units array
hexagonPoint
{point} hexagon point of advance

{boolean} advanceIsValid(index, hexagonPoint)
method to check if advance Is Valid
Parameters:
index
{integer} The unit index in units array
hexagonPoint
{point} hexagon point of advance
Returns:
{boolean} isValid

applyPhaseChangeRules()
method to apply phase change rules

{integer} calculateMoveCost(index, startHexagonPoint, endHexagonPoint)
method to calculate move cost
Parameters:
index
{integer} The unit index in units array
startHexagonPoint
{point}
endHexagonPoint
{point}
Returns:
{integer} moveCost

{integer} calculateReinforceMoveCost(index, hexagonPoint)
method to calculate reinforce cost
Parameters:
index
{integer} The unit index in units array
hexagonPoint
{point}
Returns:
{integer} moveCost

clearRetreatHexagonList()
method to clear retreat hexagon list

eliminateUnit(index)
method to eliminate unit
Parameters:
index
{integer}

{integer} getEntranceMoveCost(index, hexagonPoint)
method to get entrance cost
Parameters:
index
{integer}
hexagonPoint
{point}
Returns:
{integer} moveCost

{string} getMoveInfo(index)
method to get move info
Parameters:
index
{integer} index
Returns:
{string} moveInfo

{boolean} moveIsAcrossRiverNoBridge(hexsidePoint)
method to see if move is across a river without using a bridge
Parameters:
hexsidePoint
{point}
Returns:
{boolean} moveIsAcrossRiverNoBridge

{boolean} moveIsInRange(index, startHexagonPoint, endHexagonPoint)
method to see if move is in range
Parameters:
index
{integer} The unit index in units array
startHexagonPoint
{point}
endHexagonPoint
{point}
Returns:
{boolean} rangeIsOne

{boolean} moveIsTraverse(startHexagonPoint, endHexagonPoint, attribute)
method to see if move is traversing over terrain type
Parameters:
startHexagonPoint
{point}
endHexagonPoint
{point}
attribute
{string}
Returns:
{boolean} moveIsTraverse

{boolean} moveIsValid(index, endHexagonPoint)
method to see if move is valid
Parameters:
index
{integer}
endHexagonPoint
{point}
Returns:
{boolean} isValid

{boolean} moveOverEnemyIsAllowed()
method to see if move over enemy allowed
Returns:
{boolean} isMoveOverEnemyAllowed

{boolean} moveOverRunEnemyIsAllowed()
method to see if move over run allowed
Returns:
{boolean} isMoveOverRunEnemyAllowed

{boolean} moveWillCauseStop(index, endHexagonPoint)
method to see if move will cause stop
Parameters:
index
{integer}
endHexagonPoint
{point}
Returns:
{boolean} willCauseStop

{boolean} retreatIsBlocked(index)
method to see if retreat is blocked
Parameters:
index
{integer}
Returns:
{boolean} isBlocked

{boolean} retreatIsBlockedtoHexagonPoint(index, endHexagonPoint)
method to see if retreat is blocked at hexagon point
Parameters:
index
{integer}
endHexagonPoint
{point}
Returns:
{boolean} isBlocked

{boolean} retreatIsValid(index, endHexagonPoint)
method to see if retreat is valid
Parameters:
index
{integer}
endHexagonPoint
{point}
Returns:
{boolean} isValid

{boolean} terrainIsProhibited(index, startHexagonPoint, endHexagonPoint)
method to see if terrain is prohibited
Parameters:
index
{integer}
startHexagonPoint
{point}
endHexagonPoint
{point}
Returns:
{boolean} isProhibited

{boolean} unitCanExit(index, hexagonPoint)
method to see if unit can exit
Parameters:
index
{integer}
hexagonPoint
Returns:
{boolean} canExit

{boolean} unitCanStart(index)
method to see if unit can start
Parameters:
index
{integer}
Returns:
{boolean} canStart

{boolean} unitHasMoveAmountAvailable(index, moveAmount, moveAmountUsed)
method to see if unit has move amount
Parameters:
index
{integer}
moveAmount
{integer}
moveAmountUsed
{integer}
Returns:
{boolean} moveAmountAvailable

{boolean} unitWillUseMaxMove(index, moveAmount, moveAmountUsed)
method to see if unit will use move amount
Parameters:
index
{integer}
moveAmount
{integer}
moveAmountUsed
{integer}
Returns:
{boolean} willUseMaxMove

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Oct 22 2018 13:11:13 GMT-0700 (PDT)