diff options
author | HampusM <hampus@hampusmat.com> | 2022-01-01 13:51:51 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-01-01 13:51:51 +0100 |
commit | 1bed3ac57906b26ef05b25c2bc5c1dca424dba4a (patch) | |
tree | bd445f7800d27112b3c45199c797e8a048b0306b /src/maze.h | |
parent | 31c6239cb2fcb75aa2ec846ce88bd57a631bbd32 (diff) |
refactor: fix memory leaks & general improvements
Diffstat (limited to 'src/maze.h')
-rw-r--r-- | src/maze.h | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -3,23 +3,33 @@ #include "position_stack.h" -struct Dimensions +typedef struct Dimensions { int width; int height; -}; +} Dimensions; -struct Maze +typedef struct Maze { char ***grid; - struct Dimensions dimens; - struct Dimensions full_dimens; -}; + Dimensions dimens; + Dimensions full_dimens; +} Maze; -struct Maze maze_create(struct Dimensions dimens, char *wall); +Maze maze_create(Dimensions dimens, char *wall); -void maze_excavate(struct Maze maze, struct Position start_pos); +void maze_destroy(Maze *maze); -void maze_print(struct Maze maze); +/** + * Excavates a maze. + * + * This is what creates the actual maze. + * + * @param maze The maze to excavate + * @param start_pos Start position + */ +void maze_excavate(Maze *maze, Position start_pos); + +void maze_print(Maze maze); #endif |