Summary Files Commits Branches @commit @diff @stats
path: root / Year 2 / Structures and data algorithms / Project / exb / CityVisit.h
blob: 0dbe1fa8b62129df189c27c258cdf76d65e89558 (plain) (blame)
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
#ifndef CITY
#define CITY

#include <string>
#include <deque>
#include <utility> // използвам само pair
#include <fstream>

class CityVisit {
	struct Landmark {
		std::string name;
		std::deque<std::pair<Landmark*, unsigned>> visitable;

		Landmark(const std::string& name) : name(name), visitable() {}
	};

	std::deque<Landmark*> landmarks;
	unsigned availableTime;

	Landmark* find(const std::string& name);
	void visitTheMostInTimeRec(Landmark* currentLandmark, std::deque<Landmark*> currPath, std::deque<Landmark*> unique, int timeLeft, std::deque<Landmark*>& bestPath, unsigned& uniqueCount);

public:
	~CityVisit();

	void pushLandmarks(const std::string& from, const std::string& to, unsigned time);

	void parse(std::ifstream& inFile);
	std::deque<std::string> visitTheMostInTime(std::ifstream& inFile);
};

#endif