/datum/allocated_region
Represents a map region you have allocated access to. While you hold a reference to this region you are free to assume nothing else will allocate this part of the map and touch your region. You should also not go out of its bounds of course. Deallocate the region by qdel()ing it or dropping all references to it.
Vars | |
bottom_left | Bottom left corner of the region |
---|---|
height | Height in tiles |
name | optional friendly name for the region |
node | Corresponding node in the region_allocator quad tree |
width | Width in tiles |
Procs | |
get_center | returns the center turf of the region, biasing towards top right if dimensions even |
get_random_turf | returns a random turf in the region |
relative_turf_coords | Returns the relative coordinates of the turf in the region (1, 1) being bottom left corner. Returns null if the turf is not in the region. |
turf_at | Given local coordinates (x, y) returns you a turf at these coordinates in the region. I.e. (1, 1) will return src.bottom_left . This is the preferred method to access turfs in the region. If coordinates are out of bounds null will be returned. |
turf_in_region | Checks if a turf is in the region. |
turf_on_border | Checks if the turf is on the (inner) border of the region |
Var Details
bottom_left
Bottom left corner of the region
height
Height in tiles
name
optional friendly name for the region
node
Corresponding node in the region_allocator quad tree
width
Width in tiles
Proc Details
get_center
returns the center turf of the region, biasing towards top right if dimensions even
get_random_turf
returns a random turf in the region
relative_turf_coords
Returns the relative coordinates of the turf in the region (1, 1) being bottom left corner. Returns null if the turf is not in the region.
turf_at
Given local coordinates (x, y) returns you a turf at these coordinates in the region. I.e. (1, 1) will return src.bottom_left . This is the preferred method to access turfs in the region. If coordinates are out of bounds null will be returned.
turf_in_region
Checks if a turf is in the region.
turf_on_border
Checks if the turf is on the (inner) border of the region