-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutemanager.h
52 lines (46 loc) · 952 Bytes
/
routemanager.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
/*
* routemanager.h
*
* Created on: 7.5.2014
* Author: Atte
*/
#ifndef ROUTEMANAGER_H_
#define ROUTEMANAGER_H_
#include "genericthread.h"
#include "genericsignal.h"
#include "randomizer.h"
#include <vector>
#include <pthread.h>
typedef enum
{
BLOCK_A,
BLOCK_B,
BLOCK_C,
BLOCK_D,
BLOCK_L,
BLOCK_TRAFFICL,
BLOCK_ROAD,
BLOCK_FERRY
}ERouteBlock;
typedef enum
{
ROUTE_A_C,
ROUTE_A_D,
ROUTE_B_C,
ROUTE_B_D
}ERoute;
class RouteManager
{
public:
RouteManager(Randomizer* randomizer_h);
virtual ~RouteManager();
//fills a vector with routeblocks for a car to use
void GetRoute(std::vector<ERouteBlock>* route);
private:
void ConstructRoutes();
void AddRoads(std::vector<ERouteBlock>& route, unsigned int amount);
std::vector<std::vector<ERouteBlock> > routes;
Randomizer* randomizer;
pthread_mutex_t signal_guard;
};
#endif