Class: GridBoard

GridBoard

new GridBoard(width, height)

Grid Board (i.e. Checkers)
Parameters:
Name Type Description
width int width of the board
height int height of the board
Source:

Extends

Methods

getTile(x, y) → {Tile}

Get a Tile from the board
Parameters:
Name Type Description
x int x coordinate of the tile
y int y coordinate of the tile
Source:
Returns:
Type
Tile

getTilePosition(tile) → {Dictionary|int}

Get the position of a Tile
Parameters:
Name Type Description
tile Tile The tile to find position of
Source:
Returns:
{x: a, y: b}
Type
Dictionary | int

sendMessage(message) → {void}

Method to broadcast a message out to the other components
Parameters:
Name Type Description
message string Message to send
Inherited From:
Source:
Returns:
Type
void

subscribe(callback) → {void}

Method to subscribe to messages
Parameters:
Name Type Description
callback func A callback method to pass the message to
Inherited From:
Source:
Returns:
Type
void