public static Direction getOppositeDirection(Direction d) {

		if ( d == null ) {
			return null;
		}
		
		switch (d) {

		case N:
			return S;
		case E:
			return W;
		case S:
			return N;
		case W:
			return E;
		case FLOOR:
			return CEILING;
		case CEILING:
		default:
			return FLOOR;
		}
	}