Matthew Goldsmith
/
cis441projMS2b
CIS441 Proj MS 2b
Diff: AccCar.h
- Revision:
- 0:ca7cb51e9fd1
- Child:
- 4:ef8866873df5
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/AccCar.h Sun Nov 10 23:02:16 2019 +0000 @@ -0,0 +1,31 @@ +#ifndef _ACC_CAR_H_ +#define _ACC_CAR_H_ + +#include "mbed.h" +#include "Road.h" + +class Road; + +class AccCar{ +public: + int id; + int position; + int speed; + int flag; + + AccCar(int id, Road* road, int flag); + void set_forward_car(AccCar* car); + void set_target_speed(int speed); + void update(); + void reset(); + +protected: + int target_speed; + int cycle; + bool waited; + AccCar* forward_car; + + Road* road; + Thread* thread; +}; +#endif \ No newline at end of file