public static void calculateDistanceToBorder(BotState state) {
		Map visibleMap = state.getVisibleMap();
		for (Region region : visibleMap.getRegions()) {
			if (region.getPlayerName().equals(state.getMyPlayerName())) {
				// 1000 as initialization
				region.setDistanceToBorder(1000);
			} else {
				region.setDistanceToBorder(0);
			}
		}
		// Now do the real stuff
		boolean hasSomethingChanged = true;
		while (hasSomethingChanged) {
			hasSomethingChanged = false;
			for (Region region : state.getVisibleMap().getRegions()) {
				Region closestNeighbor = getClosestNeighborToBorder(state, region);
				if (closestNeighbor.getDistanceToBorder() < region.getDistanceToBorder()
						&& region.getDistanceToBorder() != closestNeighbor.getDistanceToBorder() + 1) {
					region.setDistanceToBorder(closestNeighbor.getDistanceToBorder() + 1);
					hasSomethingChanged = true;
				}
			}
		}
	}