Race.h 689 B

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