new ArrayBoard(width, height)
The ArrayBoard class
Parameters:
Name | Type | Description |
---|---|---|
width |
int | Number of tiles across the board |
height |
int | Number of tiles down the board |
- Source:
Extends
Methods
getTile(index) → {Tile}
Method to get the tile at the given index
Parameters:
Name | Type | Description |
---|---|---|
index |
int | The index of the tile wanted |
- Source:
Returns:
- Type
- Tile
getTilePosition(tile) → {int}
Method to get the index of a Tile in the board
Parameters:
Name | Type | Description |
---|---|---|
tile |
Tile | A board tile |
- Source:
Returns:
- Type
- 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