Class

PlayerBoardHoles

PlayerBoardHoles(player, board)

Constructor

# new PlayerBoardHoles(player, board)

Constructor
Parameters:
Name Type Description
player Player the player who owns the holes
board Board the board on which the player is placed

View Source core/PlayerBoardHoles.ts, line 53

Methods

# getHoleWithID(holeId) → {Hole}

Retrieves the Hole from the board using its given ID.
Parameters:
Name Type Description
holeId number ID to be used to retrieve hole

View Source core/PlayerBoardHoles.ts, line 120

Retrieved hole
Hole

# insertAtEnd(numSeeds) → {Hole}

Add new Holes at the end of the chain.
Parameters:
Name Type Description
numSeeds number Number of seeds to be placed in the hole.

View Source core/PlayerBoardHoles.ts, line 88

Added Hole
Hole

# stepAntiClockwise(boardHole, numSteps) → {Hole}

Step back anti-clockwise for the specified number of steps.
Parameters:
Name Type Description
boardHole Hole Starting Hole
numSteps number Number of steps to move backwards.

View Source core/PlayerBoardHoles.ts, line 151

Hole
Hole

# stepClockwise(boardHole, numSteps) → {Hole}

Step forward clockwise for the specified number of steps.
Parameters:
Name Type Description
boardHole Hole Starting Hole
numSteps number Number of steps to move backwards.

View Source core/PlayerBoardHoles.ts, line 196

The destination hole.
Hole

# validateHoleId(holeId)

Make sure that all the 16 holes have been added before attempting to retrieve any.
Parameters:
Name Type Description
holeId number Hole id to be validated.

View Source core/PlayerBoardHoles.ts, line 135

# validateNumSteps(numSteps)

Allow positive integers less than 64 for numSteps.
Parameters:
Name Type Description
numSteps number Number of steps to be made.

View Source core/PlayerBoardHoles.ts, line 184