-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain.h
More file actions
31 lines (24 loc) · 658 Bytes
/
train.h
File metadata and controls
31 lines (24 loc) · 658 Bytes
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
//
// Created by Christopher Bell on 5/8/15.
//
#include <stdio.h>
#include <stdlib.h>
#include "line.h"
#include "station.h"
#include "defs.h"
#ifndef TOUCH_TRAINS_TRAIN_H
#define TOUCH_TRAINS_TRAIN_H
typedef struct train Train;
struct train{
int id;
Line *line;
Direction direction;
Station *cur_station;
Letter letter;
};
#define INVALID_DIRECTION 1
#define IMPOSSIBLE_DIRECTION 2
Train * new_train(Station *starting_station, Direction init_direction, Letter letter);
void change_direction(Train *train);
void move_train(Train *train);
#endif //TOUCH_TRAINS_TRAIN_H