Jasmine Karlsson
/
train_rail
New project
Train.h@31:9d973398554f, 2018-06-28 (annotated)
- Committer:
- jasminealice
- Date:
- Thu Jun 28 15:08:41 2018 +0000
- Revision:
- 31:9d973398554f
- Parent:
- 29:6031227dcac9
Fiiinal!!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jasminealice | 18:f5824ba95892 | 1 | #ifndef TRAIN_H |
jasminealice | 18:f5824ba95892 | 2 | #define TRAIN_H |
jasminealice | 20:32ba0a5f2d02 | 3 | #include "Track.h" |
jasminealice | 18:f5824ba95892 | 4 | |
jasminealice | 20:32ba0a5f2d02 | 5 | |
jasminealice | 20:32ba0a5f2d02 | 6 | class Train : public Track |
jasminealice | 18:f5824ba95892 | 7 | { |
jasminealice | 18:f5824ba95892 | 8 | public: |
jasminealice | 28:1430685f4d12 | 9 | Train(const unsigned int newaddress, const unsigned int newinst, int pos,const unsigned int speed, const unsigned int speed2); |
jasminealice | 18:f5824ba95892 | 10 | virtual ~Train(); |
jasminealice | 18:f5824ba95892 | 11 | int getPosition(); |
jasminealice | 23:bb57966cb776 | 12 | void sendCommand(); |
jasminealice | 21:31647d80614f | 13 | void changeSpeed(unsigned int speed); |
jasminealice | 21:31647d80614f | 14 | void Stop(); |
jasminealice | 21:31647d80614f | 15 | unsigned int getSpeed(); |
jasminealice | 21:31647d80614f | 16 | bool checkInterupt(int pos); |
jasminealice | 21:31647d80614f | 17 | void setPosition(int pos); |
jasminealice | 23:bb57966cb776 | 18 | bool isClockwise(); |
jasminealice | 23:bb57966cb776 | 19 | void changeDirection(); |
KwamsC | 24:418711ed8c52 | 20 | bool checkStop(); |
jasminealice | 28:1430685f4d12 | 21 | unsigned int normalSpeed(); |
jasminealice | 29:6031227dcac9 | 22 | unsigned int slowlySpeed(); |
jasminealice | 21:31647d80614f | 23 | |
jasminealice | 18:f5824ba95892 | 24 | |
jasminealice | 18:f5824ba95892 | 25 | protected: |
jasminealice | 18:f5824ba95892 | 26 | |
jasminealice | 18:f5824ba95892 | 27 | private: |
jasminealice | 21:31647d80614f | 28 | int nrPacket; |
jasminealice | 18:f5824ba95892 | 29 | int position; |
jasminealice | 21:31647d80614f | 30 | bool dirClockwise; |
KwamsC | 24:418711ed8c52 | 31 | bool isStopped; |
KwamsC | 27:9f9cd0df9a79 | 32 | const unsigned int normSpeed; |
jasminealice | 28:1430685f4d12 | 33 | const unsigned int slowSpeed; |
jasminealice | 18:f5824ba95892 | 34 | }; |
jasminealice | 18:f5824ba95892 | 35 | |
jasminealice | 18:f5824ba95892 | 36 | #endif // TRAIN_H |