Jasmine Karlsson
/
train_rail
New project
Train.h@23:bb57966cb776, 2018-06-13 (annotated)
- Committer:
- jasminealice
- Date:
- Wed Jun 13 20:50:26 2018 +0000
- Revision:
- 23:bb57966cb776
- Parent:
- 21:31647d80614f
- Child:
- 24:418711ed8c52
Last changes 13/6
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(); |
jasminealice | 21:31647d80614f | 20 | |
jasminealice | 18:f5824ba95892 | 21 | |
jasminealice | 18:f5824ba95892 | 22 | protected: |
jasminealice | 18:f5824ba95892 | 23 | |
jasminealice | 18:f5824ba95892 | 24 | private: |
jasminealice | 21:31647d80614f | 25 | int nrPacket; |
jasminealice | 18:f5824ba95892 | 26 | int position; |
jasminealice | 21:31647d80614f | 27 | bool dirClockwise; |
jasminealice | 18:f5824ba95892 | 28 | }; |
jasminealice | 18:f5824ba95892 | 29 | |
jasminealice | 18:f5824ba95892 | 30 | #endif // TRAIN_H |