예제 #1
0
 /**
  * Returns the room by given condition
  * @returns Either the building or null if the room couldnt be found
  */
 public Room GetRoomBy(RoomMatchDelegate match)
 {
     Room rtn = null;
     foreach(Room room in _rooms) {
         if(match(room)) {
             rtn = room;
             break;
         }
     }
     return rtn;
 }
예제 #2
0
 /**
  * Returns all of the rooms that match the condition given in the
  * parameter.
  */
 public List<Room> GetRoomsBy(RoomMatchDelegate match)
 {
     List<Room> rtnList = new List<Room>();
     foreach(Room room in _rooms) {
         if(match(room)) {
             rtnList.Add(room);
         }
     }
     return rtnList;
 }