From ac2b0c854213a2c03008ed6e55c41878effe9273 Mon Sep 17 00:00:00 2001 From: Romain Jegat <romain.jegat@insa-rennes.fr> Date: Thu, 17 Mar 2016 20:23:17 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20structures.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/structures.h | 60 +++++++++++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/src/structures.h b/src/structures.h index 043a8b1..b4adc07 100644 --- a/src/structures.h +++ b/src/structures.h @@ -3,69 +3,87 @@ #define TAILLE_MAX_CARTE 256 #define TAILLE_NOMS 16 -/* definition des structures nécessaires : case, classe, etc */ -typedef char* type_nom; +/* definition des structures nécessaires */ + +/* SOMMAIRE */ +/* Type_terrain */ +/* Case */ +/* Attaque */ +/* Classe */ +/* Personnage */ +/* Effet */ +/* Competence */ + + typedef enum {faux, vrai} boolean; typedef struct { - type_nom nom; + char nom[TAILLE_NOMS]; boolean franchissable; + boolean franchissable_sorts; unsigned short int PD_requis; -} type_terrain; +}Type_terrain; -typedef struct { +typedef struct Case{ unsigned short int coord_x; unsigned short int coord_y; - type_terrain *terrain; + Type_terrain *terrain; boolean occupee; - boolean surbrillance; } Case; typedef Case carte[TAILLE_MAX_CARTE]; typedef struct { - type_nom nom; + char nom[TAILLE_NOMS]; unsigned short int degats_directs; unsigned short int degats_permanents; - boolean paralysie; -} attaque; + unsigned short int portee; + Effet effets[]; +} Attaque; + typedef struct { - type_nom nom; - attaque* attaques; + char nom[TAILLE_NOMS]; + Attaque* attaques; unsigned short int points_deplacement_max; unsigned short int PV_max; unsigned short int mana_max; -} classe; +} Classe; typedef struct { - type_nom nom; - classe classe; + char nom[TAILLE_NOMS]; + Classe classe; unsigned short int points_deplacement; unsigned short int PV; unsigned short int mana; - boolean paralyse; Case *position; -} personnage; + Effet effets[]; +} Personnage; + +typedef struct { + unsigned int nb_tours_restants; + unsigned int valeur_degats_duree; + unsigned int valeur_soin_duree; + boolean paralysie; +} Effet; typedef struct competence{ unsigned short int id; - type_nom nom; + char nom[TAILLE_NOMS]; unsigned short int etage; - struct competence *parent; struct competence *enfant_gauche; struct competence *enfant_droit; struct effet_competence *effet; boolean connu; -}competence; +}Competence; typedef struct effet_competence{ unsigned short int id; - type_nom nom; + char nom[TAILLE_NOMS]; /* effets à définir */ }effet_competence; -- GitLab