aboutsummaryrefslogtreecommitdiff
path: root/src/maze.h
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-01-01 13:51:51 +0100
committerHampusM <hampus@hampusmat.com>2022-01-01 13:51:51 +0100
commit1bed3ac57906b26ef05b25c2bc5c1dca424dba4a (patch)
treebd445f7800d27112b3c45199c797e8a048b0306b /src/maze.h
parent31c6239cb2fcb75aa2ec846ce88bd57a631bbd32 (diff)
refactor: fix memory leaks & general improvements
Diffstat (limited to 'src/maze.h')
-rw-r--r--src/maze.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/maze.h b/src/maze.h
index 38dfe12..8c66ff7 100644
--- a/src/maze.h
+++ b/src/maze.h
@@ -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