-
Notifications
You must be signed in to change notification settings - Fork 1
/
User.h
46 lines (43 loc) · 1.22 KB
/
User.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
#ifndef USER_HPP
#define USER_HPP
//include libraries for predefined functions such as sleep
#include <string>
#include <vector>
#include <thread>
#include "Windows.h"
#include "Junction.h"
using namespace std;
//class containing attributes and methods associated with a user
class User
{
public:
//constructor - no data is provided
User();
//constructor - data is provided
User(Junction junction, Road road);
//virtual method used to direct the function definition to the child class
//function definition not required in parent class
virtual void move(){};
//operator overloading utilised so that...
//when increase num of cars button is selected...
//num of cars is increased
User operator+(User);
//operator overloading utilised so that...
//when decrease num of cars button is selected...
//num of cars is decreased
User operator-(User);
void stop();
void start();
//variables associated with x and y postition in map
int x, y;
int getSpeed();
void setSpeed(int speed);
int getVelocity();
void setVelocity(int velocity);
void setPt(int x, int y);
int speed;
int velocity = speed;
private:
int NumOfCars;
};
#endif