private static void parseBuildings(GameField field, Scanner scanner)
			throws MapLoaderException {
		if (!scanner.next().equals("BUILDINGS")) {
			throw new MapLoaderException("Buildings section not found.");
		}

		char buildingChar;
		int x;
		int y;
		int numberOfBuildings = scanner.nextInt();
		for (int i = 0; i < numberOfBuildings; ++i) {
			buildingChar = scanner.next().charAt(0);
			BuildingTag tag = BuildingTag.getName(buildingChar);
			if (tag == null) {
				throw new MapLoaderException(String.format(
						"Invalid character in BUILDINGS section at %d line.",
						i + 1));
			}

			x = scanner.nextInt() - 1;
			y = scanner.nextInt() - 1;
			BuildingModel building;
			switch (tag) {
			case CASTLE:
				building = new Castle(x, y);
				break;
			case MILL:
				building = new Mill(x, y);
				break;
			default:
				building = null;
			}
			try {
				field.addBuilding(building, x, y);
			} catch (GameFieldException e) {
				throw new MapLoaderException(e.getMessage());
			}
		}
	}