Difference between revisions of "OnBox Object"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(Initial version of this page)
 
(added methods)
Line 48: Line 48:
An * in the "C" column indicates that the element is created by the OnBox constructor function.
An * in the "C" column indicates that the element is created by the OnBox constructor function.


This object has no methods.
== Methods in Object ==
'''stackSort()'''
The stackSort function orders the tokens by stack value high to low.
 
'''stackUp()'''
The stackUp function adds one to the stack value of each token.
 
'''stackSpread(ss)'''
The stackSpread function adds one to the stack value of each token that has a current stack value that is greater than ss.


[[Category:Design]]
[[Category:Design]]

Revision as of 14:35, 5 August 2013

This page describes a BOARD18 JavaScript object.
This object is created using the OnBox constructor function.
Go to Object List. - Go to Design Document.

The OnBox object describes all tokens on the price box with the supplied coordinates.

Data Elements in Object
Element Type C Description
boxX int * X coordinate of box
boxY int * Y coordinate of box
tokens array * Array of MarketToken objects
tokens[i].mtindex int * index of tokens[i] in BD18.marketTokens array
noToken boolean * True if there is no token on the box
oneToken boolean * True if there is one token on the box
manyTokens boolean * True if there are many tokens on the box

An * in the "C" column indicates that the element is created by the OnBox constructor function.

Methods in Object

stackSort() The stackSort function orders the tokens by stack value high to low.

stackUp() The stackUp function adds one to the stack value of each token.

stackSpread(ss) The stackSpread function adds one to the stack value of each token that has a current stack value that is greater than ss.