public boolean isMoveAllowed(int fromX, int fromY, int toX, int toY) {
        if(toX >= 0 && toY >= 0 &&
           toX < map.getWidth() && toY < map.getHeight()) {

            final int code = map.get(1, toX, toY);
            final int feature = FeatureCodes.getFeature(code);
            return 
                    feature == FeatureCodes.OPEN ||
                    feature == FeatureCodes.DOOR_OPEN ||
                    feature == FeatureCodes.DOOR_SHUT;
        }

        return false;
    }