aboutsummaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'map.h')
-rw-r--r--map.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/map.h b/map.h
index 03da971..a4cc971 100644
--- a/map.h
+++ b/map.h
@@ -34,6 +34,22 @@ unsigned int neighbours(Position neighbour_array[], Position pos, size_t width,
* TODO: formula for actual size */
Map rbt_maze_map(size_t width, size_t height, unsigned int seed);
+/* Reads the map from a file, saves size in `width` and `height`
+ *
+ * FILE FORMAT IS AS FOLLOWS:
+ * {WIDTH}x{HEIGHT}
+ * {EMPTY_CHAR}{WALL_CHAR}{START_CHAR}{END_CHAR}
+ * {MAP, one line at a time}
+ *
+ * EXAMPLE:
+ * 10x4
+ * .#@x
+ * .......x..
+ * ....###...
+ * ....#.#...
+ * ..@....... */
+Map file_plaintext_map(char *filename, size_t *width, size_t *height, Position *start_pos, Position *end_pos);
+
/* Draw the map. Bet you didn't expect that. */
void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, Position start, Position goal);