-
Notifications
You must be signed in to change notification settings - Fork 0
/
Flight.h
73 lines (64 loc) · 1.88 KB
/
Flight.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
70
71
72
73
//
// Created by Jonathan Zhu on 2023-06-06.
//
#pragma once
#include <vector>
#include <array>
#include <utility>
#include <chrono>
#include <sstream>
#include "date/date.h"
#include "Passenger.h"
#include "Attendent.h"
#include "Airport.h"
//#include "FlightDB.h"
using std::vector, std::array, std::pair, std::stringstream;
using namespace std::chrono;
using namespace date;
#ifndef AIRPLANE_BOOKING_SYSTEM_FLIGHT_H
#define AIRPLANE_BOOKING_SYSTEM_FLIGHT_H
/*
* - have json
* - have designated flight to and from locations
* - have designated flight times
* - all start location is ottawa
* - time on json is measured in minutes
*/
const static int NUM_OF_PASSENGERS = 10;
//static FlightDB flightDB{}; // TODO: review later if we even need this variable
class Flight {
private:
//Variables
array<Passenger*, NUM_OF_PASSENGERS> passengers;
array<bool, NUM_OF_PASSENGERS> seatTaken;
string from;
string to;
string flightID;
string attendentID;
array<system_clock::time_point, 2> time;
public:
//Constructor
Flight();
Flight(string f, string t, string id, string attendentID, int y, int m, int d, int h, int min, int tt);
//Accessors and Mutators
array<Passenger*, NUM_OF_PASSENGERS>& getPassengers();
string getFrom() const;
string getTo() const;
string getFlightID() const;
string getAttedentID() const;
array<bool, NUM_OF_PASSENGERS>& getSeatTaken();
string getSeatsNotTaken();
string getDepartureTime() const;
string getArrivalTime() const;
void setFrom(string f);
void setTo(string t);
void setFlightID(string id);
void setAttendentID(string id);
void setTime(int y, int m, int d, int h, int min, int t);
void buySeat(Passenger* passenger, int ind);
void removeSeat(int ind);
//toString functions
string toString();
string getDetails();
};
#endif //AIRPLANE_BOOKING_SYSTEM_FLIGHT_H