-
Notifications
You must be signed in to change notification settings - Fork 0
/
destination.h
executable file
·43 lines (37 loc) · 1.25 KB
/
destination.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
#ifndef __destination_h_
#define __destination_h_
#include <vector>
#include <map>
#include <iostream>
#include <ostream>
#include <set>
#include <fstream>
#include <string>
#include "activity.h"
class Destination {
public:
Destination(const std::string& n) { city = n; price = 0; }
Destination(const std::string& n, const Date& s, const Date& e) { city = n; start = s; end = e; price = 0; }
Destination(const std::string& n, const double& p, const Date& s, const Date& e) { city = n; price = p;
start = s; end = e; }
std::set<Activity> get() const { return agenda; }
std::string getCity() const { return city; };
void set(const std::set<Activity>& old) { agenda = old; }
int size() const { return agenda.size(); }
void add(const Activity& n) { agenda.insert(n); }
int getDays() const;
double amount() const {return price; }
void removePrice(const double& d) { price -= d; }
void addPrice(const double& d) { price += d; }
bool operator<(const Destination& obj) const;
bool operator==(const Destination& obj) const;
Date getStart() const { return start; }
Date getEnd() const { return end; }
Date start;
Date end;
private:
std::set<Activity> agenda;
std::string city;
double price;
};
#endif