A-maze-D documentation 1.0.0
Loading...
Searching...
No Matches
amazed.h File Reference

The header of the amazed project. More...

#include "mymemory.h"

Go to the source code of this file.

Data Structures

struct  robot_s
 
struct  position_s
 
struct  door_s
 
struct  room_s
 
struct  path_s
 
struct  path_info_s
 
struct  robot_path_s
 
struct  maze_s
 

Typedefs

typedef struct robot_s robot_t
 
typedef struct position_s position_t
 
typedef struct door_s door_t
 
typedef struct room_s room_t
 
typedef struct path_s path_t
 
typedef struct path_info_s path_info_t
 
typedef struct robot_path_s robot_path_t
 
typedef struct maze_s maze_t
 

Functions

void remove_comment (char *line)
 
void * return_and_free (maze_t *maze, linked_list_t **file_content, char **line)
 
int add_door (maze_t *maze, char *line)
 
int add_room (maze_t *maze, char **line)
 
int check_line (maze_t *maze, char **line, int line_index)
 
int error_handling (maze_t *maze, char **line, int line_index)
 
int get_robots_numbers (maze_t *maze, linked_list_t **file_content)
 
int next_error_handling (maze_t *maze, char **line, int line_index)
 
int next_line (maze_t *maze, char **line)
 
int check_valid_maze (maze_t *maze)
 
maze_tinit_maze (void)
 
robot_tcreate_robots_list (room_t *start, int nb_robots)
 Create a list of robots.
 
void display_path (path_t *path)
 Display the path found.
 
path_tget_best_path (room_t *start, room_t *end, my_bool_t only_free_room)
 Get the best path between two rooms.
 
void remove_robots_at_end (room_t *end, robot_t **robots)
 Remove the robots at the end of the maze.
 
void reset_rooms (room_t *rooms)
 Reset the visited attribute of each rooms.
 
void move_robots (maze_t *maze)
 Move the robots.
 
void amazed (maze_t *maze)
 

Detailed Description

The header of the amazed project.

Author
Nicolas TORO

Function Documentation

◆ create_robots_list()

robot_t * create_robots_list ( room_t * start,
int nb_robots )

Create a list of robots.

Parameters
startThe room where the robots start
nb_robotsThe number of robots
Returns
robot_t * The list of robots
Author
Nicolas TORO

◆ display_path()

void display_path ( path_t * path)

Display the path found.

Parameters
pathThe path to display
Returns
void
Author
Nicolas TORO

◆ get_best_path()

path_t * get_best_path ( room_t * start,
room_t * end,
my_bool_t only_free_room )

Get the best path between two rooms.

Parameters
startThe starting room
endThe ending room
only_free_roomIf we only want to browse free rooms
Returns
path_t * The best path found (NULL if no path found)
Author
Nicolas TORO

◆ move_robots()

void move_robots ( maze_t * maze)

Move the robots.

Parameters
mazeThe maze
Returns
void
Author
Nicolas TORO

◆ remove_robots_at_end()

void remove_robots_at_end ( room_t * end,
robot_t ** robots )

Remove the robots at the end of the maze.

Parameters
endThe end room
robotsThe list of robots
Returns
void
Author
Nicolas TORO

◆ reset_rooms()

void reset_rooms ( room_t * rooms)

Reset the visited attribute of each rooms.

Parameters
roomsThe list of rooms
Returns
void