Class: Table
Overview
Class that store a 3D array of value coded with 16bits (signed)
Instance Attribute Summary collapse
-
#dim ⇒ Integer
readonly
Dimension of the table (1D, 2D, 3D).
-
#xsize ⇒ Integer
readonly
Number of row in the table.
-
#ysize ⇒ Integer
readonly
Number of cols in the table.
-
#zsize ⇒ Integer
readonly
Number of 2D table in the table.
Class Method Summary collapse
-
.new(xsize, ysize = 1, zsize = 1)
Create a new table without pre-initialization of the contents.
Instance Method Summary collapse
-
#[](x, y = 0, z = 0) ⇒ Integer?
Access to a value of the table.
-
#[]=(x, y, z, value)
Change a value in the table.
-
#copy(table, dest_offset_x, dest_offset_y) ⇒ Boolean
Copy another table to this table.
-
#copy_modulo(table, source_origin_x, source_origin_y, dest_offset_x, dest_offset_y, width, height)
Copy another table to a specified surface of the current table using a circular copy (dest_coord = offset + source_coord % source_size).
-
#fill(value)
Fill the whole table with a specific value.
-
#resize(xsize, ysize = 1, zsize = 1)
Resize the table.
Instance Attribute Details
#dim ⇒ Integer (readonly)
Returns Dimension of the table (1D, 2D, 3D).
1320 1321 1322 |
# File 'LiteRGSS.rb.yard.rb', line 1320 def dim @dim end |
#xsize ⇒ Integer (readonly)
Returns number of row in the table.
1314 1315 1316 |
# File 'LiteRGSS.rb.yard.rb', line 1314 def xsize @xsize end |
#ysize ⇒ Integer (readonly)
Returns number of cols in the table.
1316 1317 1318 |
# File 'LiteRGSS.rb.yard.rb', line 1316 def ysize @ysize end |
#zsize ⇒ Integer (readonly)
Returns number of 2D table in the table.
1318 1319 1320 |
# File 'LiteRGSS.rb.yard.rb', line 1318 def zsize @zsize end |
Class Method Details
.new(xsize, ysize = 1, zsize = 1)
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
1281 1282 1283 |
# File 'LiteRGSS.rb.yard.rb', line 1281 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
1289 1290 1291 |
# File 'LiteRGSS.rb.yard.rb', line 1289 def [](x, y = 0, z = 0) end |
#[]=(x, y, z, value)
Change a value in the table
1295 1296 1297 |
# File 'LiteRGSS.rb.yard.rb', line 1295 def []=(x, value) end |
#copy(table, dest_offset_x, dest_offset_y) ⇒ Boolean
If any parameter is invalid (eg. dest_offset_coord < 0) the function does nothing.
Copy another table to this table
1340 1341 1342 |
# File 'LiteRGSS.rb.yard.rb', line 1340 def copy(table, dest_offset_x, dest_offset_y) end |
#copy_modulo(table, source_origin_x, source_origin_y, dest_offset_x, dest_offset_y, width, height)
Copy another table to a specified surface of the current table using a circular copy (dest_coord = offset + source_coord % source_size)
1351 1352 1353 |
# File 'LiteRGSS.rb.yard.rb', line 1351 def copy_modulo(table, source_origin_x, source_origin_y, dest_offset_x, dest_offset_y, width, height) end |
#fill(value)
Fill the whole table with a specific value
1331 1332 1333 |
# File 'LiteRGSS.rb.yard.rb', line 1331 def fill(value) end |
#resize(xsize, ysize = 1, zsize = 1)
Some value may be undeterminated if the new size is bigger than the old size
Resize the table
1326 1327 1328 |
# File 'LiteRGSS.rb.yard.rb', line 1326 def resize(xsize, ysize = 1, zsize = 1) end |