Jasmine Karlsson
/
train_rail
New project
Train.h@24:418711ed8c52, 2018-06-14 (annotated)
- Committer:
- KwamsC
- Date:
- Thu Jun 14 14:47:16 2018 +0000
- Revision:
- 24:418711ed8c52
- Parent:
- 23:bb57966cb776
- Child:
- 27:9f9cd0df9a79
all cases implemented
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 | 21:31647d80614f | 9 | Train(const unsigned int newaddress, const unsigned int newinst, int pos); |
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 | 21:31647d80614f | 21 | |
jasminealice | 18:f5824ba95892 | 22 | |
jasminealice | 18:f5824ba95892 | 23 | protected: |
jasminealice | 18:f5824ba95892 | 24 | |
jasminealice | 18:f5824ba95892 | 25 | private: |
jasminealice | 21:31647d80614f | 26 | int nrPacket; |
jasminealice | 18:f5824ba95892 | 27 | int position; |
jasminealice | 21:31647d80614f | 28 | bool dirClockwise; |
KwamsC | 24:418711ed8c52 | 29 | bool isStopped; |
jasminealice | 18:f5824ba95892 | 30 | }; |
jasminealice | 18:f5824ba95892 | 31 | |
jasminealice | 18:f5824ba95892 | 32 | #endif // TRAIN_H |