Advertisement
Guest User

Untitled

a guest
Sep 19th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. /**
  2. * @file crossroad.h
  3. * @author M.Klucar (374069)
  4. */
  5.  
  6. #ifndef CROSSROAD_H
  7. #define CROSSROAD_H
  8.  
  9. /**
  10. * @brief The Direction enum represents directions.
  11. */
  12. enum Direction {NORTH, EAST, SOUTH, WEST};
  13.  
  14.  
  15. /**
  16. * @brief The Crossroad class represents simple crossroad.
  17. * Crossroad consists of perpendicular roads denoted by cardinal directions.
  18. * A road can be considered main road.
  19. */
  20. class Crossroad {
  21.  
  22. Direction f;
  23. Direction t;
  24.  
  25. public:
  26. /**
  27. * @brief Crossroad default constructor.
  28. * EAST-WEST road is considered main.
  29. */
  30. Crossroad();
  31.  
  32. /**
  33. * @brief setMainroad sets main road.
  34. * If parameters do not represent two different directions, main road is not changed.
  35. * @param from
  36. * @param to
  37. */
  38. void setMainroad(Direction from, Direction to);
  39.  
  40. /**
  41. * @brief isMainroad checks whether road is main.
  42. * @param d
  43. * @return true iff road from direction d is considered main
  44. */
  45. bool isMainroad(Direction d) const;
  46.  
  47. };
  48.  
  49.  
  50.  
  51. #endif // CROSSROAD_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement