private void destroyWall(EnvironmentWall wall, Line2D destroyedPart) {
        boolean originalWallUsed;
        double cellWidth, cellHeight, oldWallX2, oldWallY2, newWallX1, newWallY1, newWallX2, newWallY2;
        Vector2D wallDirection;
        EnvironmentWall newWall;
        
        wallDirection    = wall.getWallDirection();
        originalWallUsed = false;
        oldWallX2        = wall.x2;
        oldWallY2        = wall.y2;
        
        if(wall.x1 != destroyedPart.getX1() || wall.y1 != destroyedPart.getY1()) {
            //First part of the remaining wall (we update the wall coordinates)
            wall.x2          = destroyedPart.getX1() - wallDirection.getDirectionX();
            wall.y2          = destroyedPart.getY1() - wallDirection.getDirectionY();
            originalWallUsed = true;
        }
        
        if(oldWallX2 != destroyedPart.getX2() || oldWallY2 != destroyedPart.getY2()) {
            //Second part of the remaining wall
            if(!originalWallUsed) {
                //We can update the wall coordinates because the first part of the wall is completely destroyed
                wall.x1 = this.correctXCoordinate(destroyedPart.getX2() + 2 * wallDirection.getDirectionX());
                wall.y1 = this.correctYCoordinate(destroyedPart.getY2() + 2 * wallDirection.getDirectionY());
            }
            else {
                //We need to create a new wall and remove the old wall in cell's references
                cellWidth  = this.configuration.getEnvironment().getCellWidth();
                cellHeight = this.configuration.getEnvironment().getCellHeight();
                newWallX1  = this.correctXCoordinate(destroyedPart.getX2() +  2 * wallDirection.getDirectionX());
                newWallY1  = this.correctYCoordinate(destroyedPart.getY2() +  2 * wallDirection.getDirectionY());
                newWallX2  = oldWallX2;
                newWallY2  = oldWallY2;
                newWall    = new EnvironmentWall(newWallX1, newWallY1, newWallX2, newWallY2, true);
                
                this.walls.add(newWall);
                
                for(Cell cell: GeometryUtils.getGridCellsCrossedByLine(newWall, cellWidth, cellHeight)) {
                    this.environment[cell.getRow()][cell.getColumn()].remove(wall);
                    this.environment[cell.getRow()][cell.getColumn()].add(newWall);
                   
                }
            }
        }
        else if(!originalWallUsed) {
            //The wall is completely removed
            this.walls.remove(wall);
        }
    }