-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTickets.hpp
More file actions
53 lines (35 loc) · 1005 Bytes
/
Tickets.hpp
File metadata and controls
53 lines (35 loc) · 1005 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef TICKET_SYSTEM_MASTER_TICKETS_HPP
#define TICKET_SYSTEM_MASTER_TICKETS_HPP
#include <iostream>
#include <string>
#include <map>
#include <set>
#include "mDataType.hpp"
#include "UserList.hpp"
#include "Query.hpp"
struct Train {
int trainID, stations[128];
char type;
int stationNum, seatNum, prices[128], startTime, travelTimes[128], stopoverTimes[128], saleDate[2];
int arrivingTimes[128], leavingTimes[128], arrDayPass[128], levDayPass[128], totalTime[128], totalPrice[128];
int released = 0;
};
class Tickets {
public:
Tickets();
~Tickets();
void add_train();
void delete_train();
void release_train();
void query_train();
void query_ticket();
void buy_ticket(UserList &users);
void query_order(UserList &users);
void refund_ticket(UserList &users);
void query_transfer();
void test();
private:
bool found(mString trainID);
std::map<int, Train> trainList;
};
#endif //TICKET_SYSTEM_MASTER_TICKETS_HPP