#ifndef MAP_H #define MAP_H #define BACKGROUND 0 #define FOREGROUND 1 #define MAP_OUTSIDE \ -2 /* Returned by get_tile_at_pos if the point is outside of \ * the map. */ #include "game.h" #include "player.h" /* Structure 'Map' has been moved to game.h */ /* to avoid circular references between map.h, game.h and player.h */ /* only methods propotypes are now in dedicated header files */ /* map_render() * * Draws the map map on the entire screen to be viewed by the player player. * game: The game struct. */ void map_render(Game *game); /* map_render_by_layer() * * Draws the map layer on the entire screen to be viewed by the player player. * game: The game struct. * layer: The layer to render. */ void map_render_by_layer(Game *game, int layer); /* map_get_tile() * * Get the tile at (x, y) of the map map. If the tile is located outside of the * screen, MAP_OUTSIDE is returned. * game: The game struct. * x: The coordinates of the tile. * y: The coordinates of the tile. * l: The layer of the tile. */ short int map_get_tile(Game *game, int x, int y, int l); /* map_get_walkable() * * Returns what is in the walkable layer at (x, y). * game: The game struct. * x: The coordinates of the tile. * y: The coordinates of the tile. */ short int map_get_walkable(Game *game, int x, int y); /* map_get_for_coordinates() * * return the pointer to the map containing the given position. * game: The game struct. * x: The coordinates to look at. * y: The coordinates to look at. */ Map *map_get_for_coordinates(Game *game, int x, int y); #endif