-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car8Cyl.h
58 lines (52 loc) · 1.79 KB
/
Car8Cyl.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
53
54
55
56
57
58
/*******************************************************************
* CS 307 Programming Assignment 3 - Traffic Simulation
* File: Car8Cyl.h
* Author: Joanna Pease
* Prog Desc: This program simulates traffic on a grid of roads.
* Vehicles travel on the roads while obeying the road's speed
* limit and the status of the traffic light at the upcoming
* intersection.
* File Desc: This file is the header file that lists all member
* variables and function prototypes for the 8 Cylinder Car
* subclass of the VehicleMovement class.
* Date: 4/9/17
*
* I attest that this program is entirely my own work, unless
* noted otherwise.
*******************************************************************/
#pragma once
#include "Inclusions.h"
#include "Map.h"
#include "Road.h"
#include "Intersection.h"
#include "VehicleMovement.h"
class Car8Cyl : public VehicleMovement
{
private:
int m_iVehicleID;
double m_dXPos;
double m_dYPos;
double m_dAcceleration;
eCompassDirection m_dDirection;
double m_dSpeedMPH;
double m_dSpeedMPS;
bool m_bTurnDecided;
eTurnDirection turnDirection;
Map *m_opMap;
public:
Car8Cyl(eCarType typeEnum, int ID, double startX, double startY, eCompassDirection direction, double acc);
~Car8Cyl();
void move();
void changeSpeed(Road *currentRoad, Intersection *nextIntersection);
void handleLocationException(eTurnDirection *turnDirection, double *nextX, double *nextY);
eTurnDirection decideTurn(Road *currentRoad, Intersection *nextIntersection, eCompassDirection currentDirection);
double getXPos();
double getYPos();
eCompassDirection getDirection();
double getSpeedMPH();
double getSpeedMPS();
eCarType getType();
double getAcceleration();
eTurnDirection getTurnDirection();
void printReport();
};