uc 19 v2 - yshehab/SchoolRoomBooking GitHub Wiki
TO DO - revise
public void addRoom(School aSchool, String aName, Collection<Assets> assets, int capacity, Roomtype roomtype)
Given: The School object school2, name Large Gym, assets theAssets, capacity 60 and roomtype GYM)
- Access the collection of Room objects linked to school2, in this case room7 and room3.
For each of these Room objects - find out it_ s RoomType
- if it is GYM, find out it_s name
- check it_s name is not "Large Gym".
As neither Room has the same type and name:
- Create room12, a new Room object, with the supplied attribute values and assets according to the supplied collection.
- school2 records a reference to room12
If a Room object linked to the school has a Room with the same type and name throw an exception.
Collection<School> schools`
public void addRoom(School aSchool, String aName, Collection<Assets> assets, int capacity, Roomtype roomtype)`
Collection<Room> Rooms
public void addRoom(String aName, Collection<Assets> assets, int capacity, Roomtype roomtype)
Collection<Asset> assets
public RoomType getType()
public String getName()
new Room(String aName, Collection<Assets> assets, int capacity, Roomtype roomtype)
School to Room
NOTE: I have included a check in the scenario to avoid duplication of room names for rooms of the same type. This seems to make sense to me to avoid confusion when booking rooms. - ben