Method: Table#initialize

Defined in:
lib/rgss_db/model/rpg_maker_data/vx/rgss/table.rb,
lib/rgss_db/model/rpg_maker_data/xp/rgss/table.rb,
lib/rgss_db/model/rpg_maker_data/vx_ace/rgss/table.rb

#initialize(xsize, ysize = 0, zsize = 0) ⇒ Table

Creates a Table object.

Specifies the size of each dimension in the multidimensional array. 1-, 2-, and 3-dimensional arrays are possible.

Arrays with no parameters are also permitted.

Parameters:

  • xsize (Integer)
  • ysize (Integer) (defaults to: 0)
  • zsize (Integer) (defaults to: 0)


23
24
25
26
27
28
29
30
31
32
# File 'lib/rgss_db/model/rpg_maker_data/vx/rgss/table.rb', line 23

def initialize(xsize, ysize = 0, zsize = 0)
  # RMXP needs dimensions
  @dim = 1
  @dim = 2 if ysize.positive?
  @dim = 3 if zsize.positive?
  @x = xsize
  @y = ysize
  @z = zsize
  @data = []
end