-
Notifications
You must be signed in to change notification settings - Fork 0
/
station.h
69 lines (56 loc) · 1.75 KB
/
station.h
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
#ifndef STATION_H
#define STATION_H
#include "public_train_generator.h"
#include <string>
#define STATION_ENTERING_TIME 1
#define STATION_LEAVING_TIME 1
class CPublicTrain;
class CCargoTrain;
class CTrack;
class CTrain;
class CStation
{
public:
CStation(const std::string& title = "");
virtual ~CStation();
const std::string& GetTitle() const;
/**
* \brief Add public train
*/
CPublicTrainGenerator& AddPublicTrain(const std::string& trainTitle,
unsigned time,
CStation& targetStation,
CPublicTrainGenerator::Frequency frequency,
unsigned targetStationArrival,
unsigned averageDelay = 0,
bool bStopsInMainStation = false,
unsigned mainStationArrival = 0,
unsigned mainStationDeparture = 0);
/**
* \brief Add cargo train
*/
CTrainGenerator& AddCargoTrain(const std::string& trainTitle,
unsigned time,
CStation& targetStation,
CPublicTrainGenerator::Frequency frequency,
unsigned targetStationArrival,
unsigned averageDelay = 0,
bool bStopsInMainStation = false,
unsigned mainStationArrival = 0,
unsigned mainStationDeparture = 0);
/**
* \brief Train enters the station
*/
virtual void Enter(CPublicTrain& train) {};
virtual void Enter(CCargoTrain& train) {};
/**
* \brief Train leaves the station
*/
virtual void Leave(CPublicTrain& train) {};
virtual void Leave(CCargoTrain& train) {};
virtual void SeizeTrack(CTrain& train, CTrack* pTrack, bool bStart) {};
virtual void ReleaseTrack(CTrain& train, CTrack* pTrack, bool bStart) {};
protected:
std::string m_Title;
};
#endif // STATION_H