INF2004-Project v0.1
 
Loading...
Searching...
No Matches
floodfill.h
Go to the documentation of this file.
1
13#ifndef FLOODFILL_H // Include guard.
14#define FLOODFILL_H
15
16#include <stdint.h>
17#include "pathfinding/maze.h"
18
19// Type definitions.
20// ----------------------------------------------------------------------------
21//
22
34typedef uint16_t (*floodfill_explore_func_t)(
35 maze_grid_t *p_grid,
36 maze_navigator_state_t *p_navigator,
38
48
49// Public function prototypes.
50// ----------------------------------------------------------------------------
51//
52
54
56 const maze_grid_cell_t *p_end_node,
57 maze_navigator_state_t *p_navigator,
58 floodfill_explore_func_t p_explore_func,
59 floodfill_move_navigator_t p_move_navigator);
60
61#endif
62
63// End of file pathfinding/floodfill.h
uint16_t(* floodfill_explore_func_t)(maze_grid_t *p_grid, maze_navigator_state_t *p_navigator, maze_cardinal_direction_t direction)
This function pointer type is used to explore the maze. It is expected to return the walls that the r...
Definition: floodfill.h:34
void floodfill_init_maze_nowall(maze_grid_t *p_grid)
This function initialises a maze with no walls to perform the floodfill algorithm on.
Definition: floodfill.c:39
void(* floodfill_move_navigator_t)(maze_navigator_state_t *p_navigator, maze_cardinal_direction_t direction)
Moves the navigator/robot in the specified direction.
Definition: floodfill.h:46
void floodfill_map_maze(maze_grid_t *p_grid, const maze_grid_cell_t *p_end_node, maze_navigator_state_t *p_navigator, floodfill_explore_func_t p_explore_func, floodfill_move_navigator_t p_move_navigator)
Runs the floodfill algorithm to map out the maze.
Definition: floodfill.c:83
Header file for the maze data structure and public functions.
maze_cardinal_direction_t
This enum contains the possible directions.
Definition: maze.h:47
This struct contains the node information.
Definition: maze.h:91
This struct contains the maze grid information.
Definition: maze.h:113
This struct contains the state of a navigator in the maze.
Definition: maze.h:124