Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @file crossroad.h
- * @author M.Klucar (374069)
- */
- #ifndef CROSSROAD_H
- #define CROSSROAD_H
- /**
- * @brief The Direction enum represents directions.
- */
- enum Direction {NORTH, EAST, SOUTH, WEST};
- /**
- * @brief The Crossroad class represents simple crossroad.
- * Crossroad consists of perpendicular roads denoted by cardinal directions.
- * A road can be considered main road.
- */
- class Crossroad {
- Direction f;
- Direction t;
- public:
- /**
- * @brief Crossroad default constructor.
- * EAST-WEST road is considered main.
- */
- Crossroad();
- /**
- * @brief setMainroad sets main road.
- * If parameters do not represent two different directions, main road is not changed.
- * @param from
- * @param to
- */
- void setMainroad(Direction from, Direction to);
- /**
- * @brief isMainroad checks whether road is main.
- * @param d
- * @return true iff road from direction d is considered main
- */
- bool isMainroad(Direction d) const;
- };
- #endif // CROSSROAD_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement