Dungeonator  1.0.0
a dungeon generator library
Macros | Typedefs | Enumerations | Functions | Variables
direction.h File Reference

declaration file for directions enum More...

#include <assert.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define NUM_DIRECTIONS   4
 

Typedefs

typedef enum Directions Direction
 

Enumerations

enum  Directions { NORTH , EAST , SOUTH , WEST }
 

Functions

void directionToDelta (Direction direction, int *dx, int *dy)
 

Variables

const Direction CARDINAL [NUM_DIRECTIONS]
 

Detailed Description

declaration file for directions enum

Macro Definition Documentation

◆ NUM_DIRECTIONS

#define NUM_DIRECTIONS   4

the number of directions in the enum

Typedef Documentation

◆ Direction

typedef enum Directions Direction

enum for the cardinal directions on a grid - used for the backtracking algorithm

Enumeration Type Documentation

◆ Directions

enum Directions

enum for the cardinal directions on a grid - used for the backtracking algorithm

Function Documentation

◆ directionToDelta()

void directionToDelta ( Direction  direction,
int *  dx,
int *  dy 
)

convert the direction enum to a change in x and y, normalized, for use by the backtracking algorithm.

Parameters
[in]directionthe direction to convert
[out]dxa pointer to a variable to write the change in x to, cannot be null
[out]dya pointer to a variable to write the change in xy to, cannot be null

Variable Documentation

◆ CARDINAL

const Direction CARDINAL[NUM_DIRECTIONS]
extern

a constant array of cardinal directions