Skip to content
Snippets Groups Projects
grid.h 1.11 KiB
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
	int number_goal;///< nombre de goal
int coordonner_vers_indice(int x, int y, struct Grid* grid);

enum CaseType* init_grid(int x, int y);

struct Player* init_player();
Arnaud Albiez's avatar
Arnaud Albiez committed
struct Grid* new_grid(int x, int y);
struct Grid* init_level(const char* file_path);

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

int get_goal(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);