Advertisement
Guest User

Untitled

a guest
Oct 9th, 2015
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Room::Room(eRoom aRoom)
  2. {
  3. myRooms = aRoom;
  4. }
  5.  
  6. void Room::Description() const
  7. {
  8. switch (myRooms)
  9. {
  10. case eRoom::eEntrance:
  11. std::cout << "You are standing infront of the ENTRANCE" << std::endl;
  12. break;
  13. case eRoom::eMainhall:
  14. std::cout << "You are standing in MAINHALL" << std::endl;
  15. break;
  16. case eRoom::eKitchen:
  17. std::cout << "You are standing in KITCHEN" << std::endl;
  18. break;
  19. case eRoom::eLivingRoom:
  20. std::cout << "You are standing in LIVING ROOM" << std::endl;
  21. break;
  22. case eRoom::eBackyard:
  23. std::cout << "You are standing in BACKYARD" << std::endl;
  24. break;
  25. case eRoom::eCellar:
  26. std::cout << "You are standing in CELLAR" << std::endl;
  27. break;
  28. default:
  29. std::cout << "ERROR" << std::endl;
  30. }
  31. }
  32.  
  33. std::string Room::GetName()
  34. {
  35. return myName;
  36. }
  37. void Room::SetName(std::string aName)
  38. {
  39. myName = aName;
  40. }
  41.  
  42. Room::~Room()
  43. {}
  44.  
  45.  
  46.  
  47.  
  48. #include <string>
  49.  
  50. enum class eRoom
  51. {
  52. eEntrance = 1,
  53. eMainhall,
  54. eKitchen,
  55. eCellar,
  56. eLivingRoom,
  57. eBackyard
  58. };
  59.  
  60. class Room
  61. {
  62. public:
  63. Room(eRoom aRoom);
  64. ~Room();
  65. void Room::Description() const;
  66. std::string GetName();
  67. void SetName(std::string aName);
  68.  
  69. private:
  70. eRoom myRooms;
  71. std::string myName;
  72. };
  73.  
  74.  
  75.  
  76.  
  77. Room entranceRoom = Room(eRoom::eEntrance);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement