1
0

Race.h 672 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _RACE_H
  2. #define _RACE_H
  3. #include "Horse.h"
  4. class Race {
  5. public:
  6. Race(); // default constructor
  7. Race(int length); // custom length
  8. std::string raceToString(); // formatted output
  9. std::string laneToString(int lane); // formatted output
  10. bool pause();
  11. bool resume();
  12. void printLane(int lane);
  13. void step();
  14. void printAllLanes();
  15. bool isFinished();
  16. void start();
  17. void printWinners();
  18. int getWinner();
  19. void logWinner(); // opens output file
  20. private:
  21. Horse *horses; // horses
  22. bool interrupt;
  23. int numHorses; // number of horses (size of array)
  24. int length; // length of the track
  25. };
  26. #endif