Skip to content
Snippets Groups Projects
grid.h 917 B
Newer Older
#ifndef GRID_HEADER
#define GRID_HEADER
#include "player.h"
enum CaseType{
	WALL = '#',
	BOX = '$',
	PLAYER = '@',
	GOAL = '.',
	NONE = ' '
};

struct Goal{
	int x, y;
};
/**
 * @struct Grid grid.h
 * @brief Cette structure contient les informations 
 * concernant la grille du jeu et son contenu
 */
struct Grid{
	enum CaseType* game_grid; ///< Tableau contenant les entités présents dans le jeu
	int column_number; ///< Nombre de colonne de game_grid
	int row_number; ///< Nomber de ligne de game_grid
	struct Player * position;///< Positioin du joueur
	struct Goal* tabGoal;///< Liste des but
	
struct Grid* init_level(const char* file_path);
Arnaud Albiez's avatar
Arnaud Albiez committed
struct Grid* new_grid(int x, int y);

enum CaseType get_grid(struct Grid* grid, int x, int y);

void Affichage_grid(struct Grid* grid);

void change_cell_grid(struct Grid* grid, int x, int y, enum CaseType new_valeur);

void free_grid(struct Grid* grid);