-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathticket.h
38 lines (32 loc) · 854 Bytes
/
ticket.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
#ifndef TICKET_H_
#define TICKET_H_
#include <string>
#include <iostream>
#include "library/pair.h"
#include "library/circularArrayList.h"
using std::string;
/*A class for representing a destination ticket in Ticket to Ride. Each
* ticket has two cities (order does not matter) and a point value.
*/
class Ticket{
private:
string cityA;
string cityB;
int points;
public:
Ticket();
Ticket(string a, string b, int pts);
Pair<string, string> getCities();
int getPoints();
void setPoints(int pts);
void setCities(string a, string b);
// to print ticket data
friend std::ostream& operator<<(std::ostream& os, const Ticket& ticket);
};
inline bool operator==(Ticket t1,Ticket t2){
if(t1.getCities() == t2.getCities() && t1.getPoints() == t2.getPoints()){
return true;
}
return false;
}
#endif