Matrix

Impementation of matrices data structure in lua. They are created in the Arena object.
Matrices are persistent so they are always saved in the server and loaded when the arena is loaded.

Method Summary
 numbergetDataType ()
 number, numbergetSize ()
 <type>getValue (number x, number y)
 nilprint ()
 nilsetValue (number x, number y, <type> value)

Method Detail

getDataType

number getDataType ()
Returns the code of the data type of the elements in the Matrix:
1- number,
2- bool,
3- string,
4- object key,
5- media item key,
6- representation key,
7- material

Returns:
number - The code of the data type of the elements in the Matrix.


getSize

number, number getSize ()
Returns the size of the Matrix (x,y).

Returns:
number - X size of the Matrix.
number - Y size of the Matrix.


getValue

<type> getValue (number x, number y)
Returns the element in the position x,y.

Parameters:
number x - X index of the element to return. Positions are counted from 1.
number y - Y index of the element to return. Positions are counted from 1.

Returns:
<type> - Eelement in the position x,y of the Matrix.


print

nil print ()
Prints the Matrix data and attributes to the console.


setValue

nil setValue (number x, number y, <type> value)
Sets an element in the Matrix.

Parameters:
number x - X index of the element to be replaced. Positions are counted from 1.
number y - Y index of the element to be replaced. Positions are counted from 1.
<type> value - Element to set in the position x,y. Must be of the same type as the Matrix.