/////////////////////////////////////////////////////////// // Softwarebauelemente I, Aufgabe O1.1 // // author: Stephan Brumme // last changes: January 13, 2001 #include "Room.h" #include // compare the room with another one Boolean CRoom::operator==(const CRoom& room) const { return ((room.m_nArea == m_nArea) && (room.m_nNumberOfRoom == m_nNumberOfRoom)); } // compare the room with another one // routes call down to "==" operator Boolean CRoom::EqualValue(const CRoom& room) const { return (operator==(room)); } // copy one room to another one // prevents user from copying an object to itself CRoom& CRoom::operator=(const CRoom& room) { // cannot copy an object to itself if (this != &room) { // copy all variables m_nArea = room.m_nArea; m_nNumberOfRoom = room.m_nNumberOfRoom; } return *this; } // copy one room to another one // prevents user from copying an object to itself // calls "=" operator internally Boolean CRoom::Copy(const CRoom &room) { // cannot copy an object to itself if (this == &room) return false; // use "=" operator operator=(room); return true; } // retrieve the private value of m_nNumberOfRoom Ordinal CRoom::GetNumberOfRoom() const { return m_nNumberOfRoom; } // change private m_nNumberOfRoom void CRoom::SetNumberOfRoom(const Ordinal nNumberOfRoom) { m_nNumberOfRoom = nNumberOfRoom; } // retrieve the private value of m_nArea Ordinal CRoom::GetArea() const { return m_nArea; } // display the attributes // only for internal purposes ! void CRoom::Show() const { // open namespace using namespace std; // display the crap using default output cout << "The current room has the room number "<