public Room SelectRoom(List<Room> rooms, int id) { foreach (Room r in rooms) { if (r.roomIndex == id) { return r; } } return rooms[0]; }