-
Notifications
You must be signed in to change notification settings - Fork 0
/
Junction.h
45 lines (36 loc) · 903 Bytes
/
Junction.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
#pragma once
#include "glut.h"
#include "Structs.h"
#include "Road.h"
class Junction {
private:
int id;
Point offset; //for drawing
Pair position; //for position in matrix
int timeIntervals[4] = {};
int greenRoad;
int numOfRoads = 4;
Road* inRoads[4] = {}; //0-UP, 3-LEFT
public:
void showDetails();
void setId(int ID);
int getId();
void setOffset(Point off);
Point getOffset();
void setPosition(Pair pos);
Pair getPosition();
void setTimeIntervals(int road0, int road1, int road2, int road3);
int* getTimeIntervals();
void setNextGreenRoad();
Car* getFirstCarInGreenLight();
void setInRoads(Road* myroads[4]);
Road** getInRoads();
Road* getGreenRoad();
void setGreenRoad(int roadNumber);
int getGreenRoadNum();
void switchLights(int inRoad);
void paintLights();
void paintLight(directions d, double r, double g, double b);
void initGreen();
void drawJunction();
};