Class: View

View

new View(game, turnMap)

The View class
Parameters:
Name Type Description
game Game the game state
turnMap TurnMap the state machine
Source:

Extends

Methods

createTileView(tileNum, x, y, width, height) → {PIXI.Graphics}

Create a view for a tile, place it at the right location
Parameters:
Name Type Description
tileNum int index of the tile on the board
x int x location of the tile
y int y location of the tile
width int width of the tile
height int height of the tile
Source:
Returns:
tileView
Type
PIXI.Graphics

destroyTokenView(tokenView)

Remove the token view from the view
Parameters:
Name Type Description
tokenView Dictionary
Source:

destroyTokenViewForToken(token)

Remove a token view from the view
Parameters:
Name Type Description
token Token the token to be destroyed
Source:

drawArrayBoard() → {void}

Draw the array board type
Source:
Returns:
Type
void

drawArrayTiles() → {void}

draw the tiles for an Array Board
Source:
Returns:
Type
void

drawBoard() → {void}

Draw the board for the given board type
Source:
Returns:
Type
void

drawGridBoard() → {void}

Draw the grid board type
Source:
Returns:
Type
void

drawTile(tile, size) → {PIXI.Graphics}

Draw a single tile Override this method in your subclass to customize the board
Parameters:
Name Type Description
tile Tile the tile model object
size Dictionary The width and height for the tile
Source:
Returns:
tileView
Type
PIXI.Graphics

drawTiles() → {void}

Draw tile for the grid board
Source:
Returns:
Type
void

drawToken(token, size)

Draw a tokens Override this method in subclass to customize token drawing
Parameters:
Name Type Description
token Token token model data
size Dictionary width and height of token
Source:

drawTokens() → {void}

Draw all the tokens on the board
Source:
Returns:
Type
void

getTileViewForToken(token) → {PIXI.Graphics}

Get the tile view that a token is on
Parameters:
Name Type Description
token Token A game token
Source:
Returns:
tileView
Type
PIXI.Graphics

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

updateTokens()

Update all of the tokens on the board
Source:

updateTokenView(tokenView) → {void}

Update the token view if the token moved
Parameters:
Name Type Description
tokenView Dictionary
Source:
Returns:
Type
void