public SquareType getSquareType(Coord c) {
        int squareValue = mat.getSquareValue(c);

        if (squareValue == -1) {
            return SquareType.OUTSIDE;
        }
        else if (squareValue == 0) {
            return SquareType.OBSTACLE;
        }
        else if (squareValue == 1) {
            return SquareType.FREESQUARE;
        }
        else if (squareValue >= 10 && squareValue < 30) {
            return SquareType.DOOR;
        }
        else if (squareValue >= 30 && squareValue < 40) {
            return SquareType.CHEST;
        }
        else {
            assert false : "Square type unknown : " + squareValue;
            return null;
        }
    }