forked from Biskott/Lo41-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.h
More file actions
71 lines (57 loc) · 1.41 KB
/
Copy pathtrain.h
File metadata and controls
71 lines (57 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**********************************************
* Librairie pour la gestion de trains *
* Projet LO41 - Printemps 2016 *
* Auteurs : *
* Florian Bishop et Elise Kocik *
**********************************************/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <string.h>
#ifndef TRAIN_H
#define TRAIN_H
/**********************************************
* Définition des destinations *
**********************************************/
char* tab_Dest[]={
"Chez P.Descamps",
"Hurlevent",
"Mamene",
"Le Crew",
"Dalaran",
"Palaiseau",
"Fond de l'étang",
"Semestre Sup",
"Strasbourg",
"Cul-de-Sac"
};
/**********************************************
* Définition du type Train *
**********************************************/
typedef enum {
EO,
OE
} Direction;
typedef enum {
TGV,
GL,
M
} Type;
typedef struct {
Type type;
Direction direction;
int id;
char* destination;
} Train;
/**********************************************
* Fonctions sur les Trains *
**********************************************/
/** Crée un nouveau train avec l'id et le type spécifié
* La destination est aléatoire*/
Train* createTrain(int id, Type type, Direction dir);
/**Crée un train aléatoire**/
Train* randomTrain(int id);
/** Suppression du train*/
void deleteTrain(Train *t);
#endif /* TRAIN_H */