-
Notifications
You must be signed in to change notification settings - Fork 0
/
Statistics.h
46 lines (41 loc) · 1.39 KB
/
Statistics.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
#pragma once
#include <chrono>
#include <vector>
#include "Runway.h"
class Statistics {
private:
int crashedAircraftCount;
std::chrono::seconds totalLandingTime;
std::chrono::seconds totalTakeoffTime;
int totalFuelAvailable;
int landingCount;
int takeoffCount;
int totalLandedPlanes;
int totalTookOffPlanes;
std::chrono::seconds totalLandingWaitTime;
std::chrono::seconds totalTakeoffWaitTime;
public:
Statistics();
void aircraftCrashed();
void displayStatistics() const;
void updateLandingTime(std::chrono::seconds time);
void updateTakeoffTime(std::chrono::seconds time);
void updateFuelAvailable(int fuel);
void updateLandingCount();
void updateTakeoffCount();
void updateLandingWaitTime(std::chrono::seconds waitTime);
void updateTakeoffWaitTime(std::chrono::seconds waitTime);
double getAverageLandingWaitTime() const;
double getAverageTakeoffWaitTime() const;
int getCrashedAircraftCount() const;
int getLandingCount() const;
int getTakeoffCount() const;
std::chrono::seconds getTotalLandingTime() const;
std::chrono::seconds getTotalTakeoffTime() const;
int getTotalFuelAvailable() const;
int getTotalLandedPlanes() const;
int getTotalTookOffPlanes() const;
void incrementLandedPlanes();
void updateStatistics(const std::vector<Runway>& runways);
void incrementTookOffPlanes();
};