Dungeonator
1.0.0
a dungeon generator library
|
file for connections between regions (doors) More...
Go to the source code of this file.
Data Structures | |
struct | Connectors |
Macros | |
#define | CONNECTOR_ALLOC_SIZE 50 |
Typedefs | |
typedef struct Connectors | Connector |
Functions | |
Connector * | getConnectors (Grid *grid, regions_t regions, size_t *num_connectors) |
int * | mapMergedRegions (Connector *connector, int *merged, int *num_regions) |
file for connections between regions (doors)
#define CONNECTOR_ALLOC_SIZE 50 |
the default size to expand the connector array by each time. can be overrided by the user by defining it themselves
typedef struct Connectors Connector |
A struct to represent a connection between 2 regions
given a grid (for size information) and a list of the various regions, get the potential connectors between them
[in] | grid | a pointer to a grid to get width and height info |
[in] | regions | the 2d regions array to determine which region a tile is in |
[out] | num_connectors | the number of connectors found - make sure to use this to avoid undefined behavior |
int* mapMergedRegions | ( | Connector * | connector, |
int * | merged, | ||
int * | num_regions | ||
) |
take the region for a connector and use a mapping array to process potential merging it's regions also deduplicates array, so each region will only be included once
[in] | connector | a pointer to the connector to map the regions of |
[in] | merged | an array that will be used to map the various regions |
[out] | num_regions | the number of regions in the ouput array |