} else if (args.get(3).equals("level")) {
String rejectMessage = null;
if (args.size() == 7) {
rejectMessage = args.get(6);
}
return new LevelCheckingPortal(Integer.parseInt(args.get(4)), Integer.parseInt(args.get(5)), rejectMessage);
}
throw new IllegalArgumentException("Invalid portal type.");
}