Board18Market2

From BOARD18 Project WIKI
Revision as of 09:13, 9 September 2014 by Rich (talk | contribs) (Initial version of this page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

board18Market2.js contains the BOARD18 startup functions.

Function makeTrays()

The makeTrays() function initializes all of the tray objects. It calls the TokenSheet constructor for each mtok sheet. It also adds the trayNumb to each new tray object. Finally it initializes BD18.curTrayNumb to 0 and BD18.trayCount to the number of tray objects.

Function makeMktTokenList()

This function initializes the BD18.marketTokens array. It calls the MarketToken constructor for each token in BD18.gm.mktTks array and adds the new object to the BD18.marketTokens array.

Function trayCanvasApp()

Function trayCanvasApp calls the trays.place() method for the current token sheet object. This sets up the tray Canvas.

Function mainCanvasApp()

Function mainCanvasApp calls the stockMarket.place() method. This sets up the main Canvas.

Function toknCanvasApp(keepBoxSelect)

Function toknCanvasApp places all existing tokens on the stock market using the BD18.marketTokens array.

Function canvasApp()

Function CanvasApp initializes all canvases. It then calls trayCanvasApp and mainCanvasApp.

Function itemLoaded(event)

This function is an event handler for the game box images. It calls makeTrays, makeBdTokenList and canvasApp after all itemLoaded events have occured.

Function loadBox(box)

The loadBox function is a callback function for the gameBox.php getJSON function. It loads all the game box images. Then it calls the makeMenues function.

Function loadSession(session)

The loadSession function is a callback function for the gameSession.php getJSON function. It finds and loads the game box file.