For working with chunks.
A chunk represents a 32 tile2 on a surface in Factorio.
local Chunk = require('__stdlib__/stdlib/area/chunk')
from_position() | Gets the chunk position of a chunk where the specified position resides. |
to_position() | Gets the top_left position from a chunk position. |
to_area(pos) | Gets the area of a chunk from the specified chunk position. |
get_data(surface, chunk_pos[, default_value]) | Gets the user data that is associated with a chunk. |
set_data(surface, chunk_pos, value) | Associates the user data to a chunk. |
Gets the chunk position of a chunk where the specified position resides.
See also:
Gets the top_left position from a chunk position.
See also:
Gets the area of a chunk from the specified chunk position.
Parameters:
Gets the user data that is associated with a chunk.
The user data is stored in the global object and it persists between loads.
Parameters:Associates the user data to a chunk.
The user data will be stored in the global object and it will persist between loads.
Parameters: