Class: Table32

Inherits:
Object show all
Defined in:
LiteRGSS.rb.yard.rb

Overview

Class that store a 3D array of value coded with 32bits (signed)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dimInteger (readonly)

Returns Dimension of the table (1D, 2D, 3D).

Returns:

  • (Integer)

    Dimension of the table (1D, 2D, 3D)



1401
1402
1403
# File 'LiteRGSS.rb.yard.rb', line 1401

def dim
  @dim
end

#xsizeInteger (readonly)

Returns number of row in the table.

Returns:

  • (Integer)

    number of row in the table



1395
1396
1397
# File 'LiteRGSS.rb.yard.rb', line 1395

def xsize
  @xsize
end

#ysizeInteger (readonly)

Returns number of cols in the table.

Returns:

  • (Integer)

    number of cols in the table



1397
1398
1399
# File 'LiteRGSS.rb.yard.rb', line 1397

def ysize
  @ysize
end

#zsizeInteger (readonly)

Returns number of 2D table in the table.

Returns:

  • (Integer)

    number of 2D table in the table



1399
1400
1401
# File 'LiteRGSS.rb.yard.rb', line 1399

def zsize
  @zsize
end

Class Method Details

.new(xsize, ysize = 1, zsize = 1)

Note:

Never call initialize from the Ruby code other than using Table.new. It'll create memory if you call initialize from Ruby, use #resize instead.

Create a new table without pre-initialization of the contents

Parameters:

  • xsize (Integer)

    number of row

  • ysize (Integer) (defaults to: 1)

    number of cols

  • zsize (Integer) (defaults to: 1)

    number of 2D table



1362
1363
1364
# File 'LiteRGSS.rb.yard.rb', line 1362

def self.new(xsize, ysize = 1, zsize = 1)

end

Instance Method Details

#[](x, y = 0, z = 0) ⇒ Integer?

Access to a value of the table

Parameters:

  • x (Integer)

    index of the row

  • y (Integer) (defaults to: 0)

    index of the col

  • z (Integer) (defaults to: 0)

    index of the 2D table

Returns:

  • (Integer, nil)

    nil if x, y or z are outside of the table.



1370
1371
1372
# File 'LiteRGSS.rb.yard.rb', line 1370

def [](x, y = 0, z = 0)

end

#[]=(x, y, z, value)

Change a value in the table

Parameters:

  • x (Integer)

    row index of the cell to affect to the new value

  • y (Integer)

    col index of the cell to affect to the new value

  • z (Integer)

    index of the table containing the cell to affect to the new value

  • value (Integer)

    new value



1376
1377
1378
# File 'LiteRGSS.rb.yard.rb', line 1376

def []=(x, value)

end

#fill(value)

Fill the whole table with a specific value

Parameters:

  • value (Integer)

    the value to affect to every cell of the table



1412
1413
1414
# File 'LiteRGSS.rb.yard.rb', line 1412

def fill(value)

end

#resize(xsize, ysize = 1, zsize = 1)

Note:

Some value may be undeterminated if the new size is bigger than the old size

Resize the table

Parameters:

  • xsize (Integer)

    number of row

  • ysize (Integer) (defaults to: 1)

    number of cols

  • zsize (Integer) (defaults to: 1)

    number of 2D table



1407
1408
1409
# File 'LiteRGSS.rb.yard.rb', line 1407

def resize(xsize, ysize = 1, zsize = 1)

end