-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunway.h
50 lines (42 loc) · 1 KB
/
runway.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
// Runway.h
#pragma once
#include "IdCodeGenerator.h"
#include <string>
#include <chrono>
enum class RunwayStatus
{
OCCUPIED,
FREE
};
enum class RunwayOperation
{
LANDING,
TAKEOFF,
NONE
};
class Runway : public IdCodeGenerator
{
private:
int id;
std::string code;
RunwayStatus status;
RunwayOperation lastOperation;
bool hasPriority;
int planesLanded;
int planesTakeOff;
std::chrono::steady_clock::time_point lastChangeTime;
public:
Runway(RunwayStatus status, bool priority);
RunwayStatus getStatus() const;
bool hasLandingPriority() const;
int getPlanesLanded() const;
int getPlanesTakeOff() const;
std::string getStatusString() const;
const std::string& getCode() const;
void setStatus(RunwayStatus status);
void setPriority(bool priority);
void incrementPlanesLanded();
void incrementPlanesTakeOff();
RunwayOperation getLastOperation() const;
std::chrono::steady_clock::time_point getLastChangeTime() const;
};