@Override public Dimension preferredLayoutSize(Container parent) {
		int mapSize = fieldCardComponents.size();
		Dimension dimension = new Dimension(0, 0);
		//rounds up the map size if the amount of cards is divisible by four
		if(fieldCardComponents.size() % 4 != 0) {
			switch(mapSize % 4) {
				case 1:
					mapSize += 3;
					break;
				case 2:
					mapSize += 2;
					break;
				case 3:
					mapSize += 1;
					break;
			}
		}
		//calculates the total width and height of the map
		dimension.width = ((mapSize / 4) - 1) * FieldCard.widthCard + 2 * FieldCard.heightCard;
		dimension.height = dimension.width;

		return dimension;
	}