Board

Base board class

new Board(options: any)

Extends Component

Parameters
options (any)
Static Members
▸ onClick
▸ events
▸ render(container)
▸ remove()

Fleet

Base fleet class

new Fleet(options: any)

Extends Component

Parameters
options (any)
Static Members
▸ render(container)
▸ remove()

Component

Base class for components

new Component(renderOptions: any)
Parameters
renderOptions (any)

Utils

Utility functions

Utils
Static Members
▸ getNthLetter(index)
▸ getElementIndex(element)
▸ shipCellCount(numberOfShip)
▸ getNeighbourCells(row, col)
▸ getAllNeighbourCells(row, col)

View

Base class for views

new View(options: options, templateDirectory: any)
Parameters
options (options)
templateDirectory (any)
Static Members
▸ name
▸ index
▸ activeViews
▸ viewTemplate
▸ render(container)

GameBoardView

Base GameBoard class

new GameBoardView(options: any)

Extends View

Parameters
options (any)
Static Members
▸ render(container)
▸ render(container)
▸ turn(player)
▸ handleBoardClick(owner, event)
▸ promptUser(question, buttonLeftText, buttonRightText, callback)
▸ checkOffenceResult(row, col, cell)
▸ findShip(row, col)
▸ addBorder()
▸ checkWin(owner)
▸ remove()

GameOverView

Base GameOverView class

new GameOverView(options: any)

Extends View

Parameters
options (any)
Static Members
▸ remove()

MainView

Base MainView class

new MainView(options: any)

Extends View

Parameters
options (any)
Static Members
▸ render(container)
▸ handleClick(target)
▸ remove()

ShipPlacementView

Base ShipPlacementView class

new ShipPlacementView(options: any)

Extends View

Parameters
options (any)
Static Members
▸ render(container)
▸ handleSelectedShipChange(target)
▸ handleRotateShip()
▸ handleBoardCellOver(options, row, column)
▸ handleBoardCellOut()
▸ handleBoardCellClick()
▸ handleFinishPlacement()
▸ remove()