[Solved] Rooms and Guests (object add to another object?)


Changed it completely and used the room number to connect the room and guest using Hashtables.

public static Hashtable checkBookedRooms(string Rtype)
     {
         Hashtable roomsAvailable = new Hashtable();
         int i = 0;

        foreach(Room room in AllRooms)
        {
            i++;
            if(room.booked==false && room.RoomType == Rtype)
            {
                roomsAvailable.Add(room.RoomNumber, room.RoomType);
            }  
            if(i >= AllRooms.Count)
            {
                i = 0;
                return roomsAvailable;

            }
        }
        Console.WriteLine("Room.checkBookedRooms() Returned Null");
        return null;
     }

solved Rooms and Guests (object add to another object?)