From d4d8a87d9c9b024c0eacefa48941822a0bae7437 Mon Sep 17 00:00:00 2001 From: Henri Montjoie <henri.montjoie@insa-rennes.fr> Date: Sat, 27 Feb 2016 21:52:15 +0100 Subject: [PATCH] definition des structures --- src/main.c | 2 +- src/structures.h | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/structures.h diff --git a/src/main.c b/src/main.c index 807a785..3754dd5 100644 --- a/src/main.c +++ b/src/main.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <stdlib.h> +#include "structures.h" int main() { @@ -7,4 +8,3 @@ int main() return 0; } -/*test*/ diff --git a/src/structures.h b/src/structures.h new file mode 100644 index 0000000..d148843 --- /dev/null +++ b/src/structures.h @@ -0,0 +1,40 @@ +#ifndef STRUCTURES_H_INCLUDED +#define STRUCTURES_H_INCLUDED + +/* definition des structures nécessaires : case, classe, etc */ + +typedef enum {plaine,eau,montagne,foret} type_terrain; + +typedef enum {faux, vrai} boolean; + +typedef struct { + unsigned short int coord_x; + unsigned short int coord_y; + type_terrain terrain; + boolean occupee; +} Case; + +typedef struct { + char nom[16]; + unsigned short int degats_directs; + unsigned short int degats_permanents; + boolean paralysie; +} attaque; + +typedef struct { + char nom[16]; + attaque attaque; + unsigned short int points_deplacement_max; + unsigned short int PV_max; +} classe; + +typedef struct { + char nom[16]; + classe classe; + unsigned short int points_deplacement; + unsigned short int PV; + boolean paralyse; + Case position; +} personnage; + +#endif -- GitLab