All the functions used to verify the map.
More...
All the functions used to verify the map.
◆ check_map_chars_borders()
Check if the map has only acceptable characters and if there is borders everywhere, as it should be.
- Parameters
-
- Returns
- t_map map structure
◆ find_position()
Find the position of the player with charset in the map.
- Parameters
-
| map | map structure |
| charset | strings of autorized characters for player |
- Returns
- t_coordinates coordinates of player
◆ ft_check_config()
Check if the config is properly formatted or not.
- Parameters
-
- Returns
- t_map map structure
◆ ft_check_floor_ceiling()
Check the floor and ceiling colors.
- Parameters
-
- Returns
- t_map map structure
◆ ft_map_check_dimensions()
| t_map ft_map_check_dimensions |
( |
t_map * | map, |
|
|
char * | map_name ) |
Check the map structure and try to open the map file. sets error to -1 if an error occurred.
- Parameters
-
| map | map structure to check and initialize |
| map_name | name of the map file. |
- Returns
- t_map Structure containing the map dimensions and metadata.
◆ is_config_line()
| size_t is_config_line |
( |
char * | line | ) |
|
Return a positive number if a config line is detected.
- Parameters
-
- Returns
- int 0 not config line, positive number otherwise
◆ is_in_bounds()
| int is_in_bounds |
( |
char ** | map, |
|
|
size_t | y, |
|
|
size_t | x ) |
Check if a position is in bounds of map or not.
- Parameters
-
| map | array of strings representing map |
| y | y axis (number of lines) |
| x | x axis (length of line) |
- Returns
- int 1 OK, error otherwise
◆ is_only_whitespace()
| bool is_only_whitespace |
( |
const char * | str | ) |
|
Check if the string contains only whitespace characters.
- Parameters
-
- Returns
- bool 1 all whitespace, 0 otherwise
◆ is_walkable()
| int is_walkable |
( |
char | c | ) |
|
Check if a character is walkable or not.
- Parameters
-
- Returns
- int 1 OK, error otherwise
◆ suppress_newlines()
| void suppress_newlines |
( |
char ** | lines | ) |
|
Suppress newlines in the given lines.
- Parameters
-
| [in,out] | lines | Array of strings to modify |
◆ validate_map()
| int validate_map |
( |
t_map * | map | ) |
|
Validate if the map has unclosed holes or an unfinished outer layer.
- Parameters
-
- Returns
- int 1 OK, error otherwise