-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvehicle.hpp
57 lines (48 loc) · 1.4 KB
/
vehicle.hpp
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
53
54
55
56
57
#ifndef vehicle_h
#define vehicle_h
class Road;
#include <vector>
#include <string>
#include "road.hpp"
using namespace std;
class Vehicle
{
private:
Road *rd;
int length;
int width;
int height;
int id;
string color;
int max_speed;
int acceleration; //Make sure acceleration is not greater than max_speed.
vector<int> pos;
vector<int> velocity;
char display;
// In xml file when multiple vehicles are defined simultaneously, in the simulation they will
//side by side. If no of vehicles exceeds road width, it will throw an error.
//All vehicles will be spawned at the starting line.
public:
int opengl_diagonal;
Vehicle(Road *rd, int len, int wid, int h, string col, int max_sp, int acc, char disp, int i, vector<int> position);
Vehicle(const Vehicle &obj);
int get_length();
int get_width();
int get_height();
int get_id();
string get_color();
int get_max_speed();
int get_acceleration();
vector<int> get_pos();
vector<int> get_velocity();
int get_display_char();
int get_accident_truth();
void set_acceleration(int acc);
void set_pos(int x, int y);
void set_velocity(vector<int> v);
void set_velocity(int x, int y);
bool can_go_left();
bool can_go_right();
void update();
};
#endif