2024-11-18 07:17:53 +01:00
|
|
|
#ifndef JEU_H_INCLUS
|
|
|
|
|
#define JEU_H_INCLUS
|
2024-11-14 12:12:14 +01:00
|
|
|
|
2024-11-21 12:08:15 +01:00
|
|
|
/* Structure qui représente une position sur la grille */
|
2024-11-18 06:48:24 +01:00
|
|
|
struct Position {
|
|
|
|
|
int x;
|
|
|
|
|
int y;
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-21 12:08:15 +01:00
|
|
|
/* Structure qui représente l'état du jeu */
|
2024-11-14 12:12:14 +01:00
|
|
|
struct EtatJeu {
|
2024-11-16 11:24:19 +01:00
|
|
|
int tailleGrille;
|
|
|
|
|
int mode;
|
2024-11-14 12:12:14 +01:00
|
|
|
int tourJoueur;
|
2024-11-18 07:17:53 +01:00
|
|
|
int phase;
|
2024-11-18 06:48:24 +01:00
|
|
|
struct Position joueur1;
|
|
|
|
|
struct Position joueur2;
|
2024-11-18 07:17:53 +01:00
|
|
|
int** grille;
|
2024-11-14 12:12:14 +01:00
|
|
|
};
|
|
|
|
|
|
2024-11-21 12:08:15 +01:00
|
|
|
/* Fonction qui initialise le jeu */
|
2024-11-14 12:12:14 +01:00
|
|
|
struct EtatJeu initialiserJeu(int tailleGrille, int mode);
|
2024-11-21 12:08:15 +01:00
|
|
|
|
|
|
|
|
/* Fonction qui dessine la grille de jeu */
|
2024-11-16 11:24:19 +01:00
|
|
|
void dessinerGrille(struct EtatJeu etatJeu);
|
2024-11-21 12:08:15 +01:00
|
|
|
|
|
|
|
|
/* Fonction qui vérifie si le joueur a gagné la partie */
|
2024-11-16 11:24:19 +01:00
|
|
|
int verifierVictoire(struct EtatJeu etatJeu);
|
2024-11-21 12:08:15 +01:00
|
|
|
|
|
|
|
|
/* Fonction qui affiche le gagnant de la partie */
|
2024-11-17 02:54:00 +01:00
|
|
|
void afficherVictoire(int gagnant);
|
2024-11-21 12:08:15 +01:00
|
|
|
|
|
|
|
|
/* Fonction qui vérifie si deux cases sont adjacentes */
|
2024-11-18 06:48:24 +01:00
|
|
|
int estCaseAdjacente(struct Position pos1, struct Position pos2);
|
2024-11-21 12:08:15 +01:00
|
|
|
|
|
|
|
|
/* Fonction qui vérifie si le joueur peut déplacer son pion */
|
2024-11-18 06:48:24 +01:00
|
|
|
int peutDeplacer(struct EtatJeu etatJeu, int joueur);
|
2024-11-14 12:12:14 +01:00
|
|
|
|
2024-11-21 12:33:32 +01:00
|
|
|
|
2024-11-18 07:17:53 +01:00
|
|
|
#endif /* JEU_H_INCLUS */
|