The Grid2D is a two dimensional dynamics array.

The class a one dimensional array to contain all data and act as a 2D array for its users.


Class Details


Variables (Members):


Name

Type

Default Value

Description

xLength

Integer

0

Define the actual x length of the array (horizontal).

yLength

Integer

0

Define the actual y length of the array (vertical).



Functions:


Name

Arguments

Return

Description

Add

  • Class: Data - data you want to store in the array
  • Integer: PosX - horizontal position of the new data
  • Integer: PosY - vertical position of the new data
  • Boolean: Override - define if the new data can override an existing data if there is already something at designated position

VOID

This function is used to store a new data inside the dynamics array. By going out of scope the class will immediately "extends the array" (just update information).


 !! You can't use the [][] for this array !!

Clear

None

VOID

Empty the whole array and information

Get

  • Integer: X - X (horizontal) position of the data
  • Integer: Y - Y (vertical) position of the data

Class

Get the data at designated position

GetAll

None

Array (Array (Class))

Get the entire array in form of a 2 dimensional array (javascript form), it add the null values.

GetColumn

  • Integer: X - Column number to extract
  • Boolean: WithNull - Define if the output array contain or not the empty cases

Array (class)

Get an entire column  of data with or without the empty cases

GetLine

  • Integer: Y - Line number to extract
  • Boolean: WithNull - Define if the output array contain or not the empty cases

Array (class)

Get an entire line of data with or without the empty cases

Move

  • Integer: X - original X (horizontal) position of the data
  • Integer: Y - original Y (vertical) position of the data
  • Integer: ToX - new X (horizontal) position of the data
  • Integer: ToY - new Y (vertical) position of the data
  • Boolean: Override - define if the moved data can override an existing data if there is already something at designated position

VOID

Move a data from a position to another. Note, like add and remove the array will adjust it self.

Remove

  • Integer: PosX - horizontal position of the data to remove
  • Integer: PosY - vertical position of the data to remove

VOID

Call this function to delete a data at designated position. If the removing let empty space and the array can reduce his size it will update length info automatically.



Private Details



All private details are usable but its recommended to not use any of those. It might modify the proper functioning of the class.



Variables (Members):


Name

Type

Default Value

Description

Data

  • (Empty Array)
  • N/A

Array holding all the data. This is a one dimensional array.

All the data are in a binding class: GridObject


!! Is strongly advise for use to not touching it and use class property instead !!

lastID

Integer

0

Hold the last ID used for one of the data (see GridObject for more info about id).



Functions:


Name

Arguments

Return

Description

UpdateInfo

None

VOID

This function will go through the array Data to update all info about the Array.

Created with the Personal Edition of HelpNDoc: Easy EPub and documentation editor