src/NodeHeap.cpp
// Removes and returns the first element. The element is then replaced with the last element in 
// the collection. The heap is then sorted again using the sortDown method. 
Removes and returns the first element. The element is then replaced with the last element in
the collection. The heap is then sorted again using the sortDown method.
Removes and returns the first element . The element is then replaced with the last element in the collection . The heap is then sorted again using the sortDown method .
Coordinates removeFirst(NodeHeap& heap) {
        Coordinates firstCoords = heap.coordinates.front();
        heap.indices[firstCoords.x][firstCoords.y] = -1;
        heap.coordinates.front() = std::move(heap.coordinates.back());
        heap.coordinates.pop_back();
        heap.fCosts.front() = std::move(heap.fCosts.back());
        heap.fCosts.pop_back();
        sortDown(heap);
        return firstCoords;
    }
Coordinates removeFirst ( NodeHeap & heap ) { Coordinates firstCoords = heap . coordinates . front ( ) ; heap . indices [ firstCoords . x ] [ firstCoords . y ] = -1 ; heap . coordinates . front ( ) = std :: move ( heap . coordinates . back ( ) ) ; heap . coordinates . pop_back ( ) ; heap . fCosts . front ( ) = std :: move ( heap . fCosts . back ( ) ) ; heap . fCosts . pop_back ( ) ; sortDown ( heap ) ; return firstCoords ; }
Removes and returns the first element.
Removes and returns the first element .
// Update the index of the first element to -1 since it no longer lives in the heap.  // Move the values at the back to the front and reduce the size of the array.  //std::cout << "First element used to be: " << firstCoords.x << ", "  //        << firstCoords.y << std::endl; //std::cout << "coords is now size: " << heap.coordinates.size() << std::endl; // Sort from the top (since the last element has been placed at the front of the heap). //std::cout << "First element is now: " << heap.coordinates.front().x << ", "  //        << heap.coordinates.front().y << std::endl; // return the first coordinates. 