Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/models/Room.cpp
T
2026-04-17 10:37:55 +05:30

50 lines
886 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
File: Room.cpp
* Description : Models a room entity that maintains room details and manages its bookings.
* Author : Trenser
* Created : 31-Mar-2026
*/
#include "Room.h"
int Room::m_uid = 0;
const std::string& Room::getRoomId() const
{
return m_id;
}
const std::string& Room::getRoomName() const
{
return m_name;
}
const bookingMap& Room::getBookings() const
{
return m_bookings;
}
void Room::setRoomId(const std::string& id)
{
m_id = id;
}
void Room::setRoomName(const std::string& name)
{
m_name = name;
}
/*
Function: addBooking
Description: Adds a valid booking to the rooms booking list using the booking ID as the key.
Parameters:
booking - A pointer to a Booking object to be added to the room.
Returns:
void
*/
void Room::addBooking(Booking* booking)
{
if (booking)
{
m_bookings[booking->getBookingId()] = booking;
}
}