MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / pop

Method pop

src/Battlescape/PathfindingOpenSet.cpp:57–69  ·  view source on GitHub ↗

* Gets the node with the least cost. * After this call, the node is no longer in the set. It is an error to call this when the set is empty. * @return A pointer to the node which had the least cost. */

Source from the content-addressed store, hash-verified

55 * @return A pointer to the node which had the least cost.
56 */
57PathfindingNode *PathfindingOpenSet::pop()
58{
59 assert(!empty());
60 OpenSetEntry *entry = _queue.top();
61 PathfindingNode *nd = entry->_node;
62 _queue.pop();
63 delete entry;
64 nd->_openentry = 0;
65
66 // Discarded entries might be visible now.
67 removeDiscarded();
68 return nd;
69}
70
71/**
72 * Places the node in the set.

Callers 5

aStarPathMethod · 0.80
findReachableMethod · 0.80
~PathfindingOpenSetMethod · 0.80
removeDiscardedMethod · 0.80

Calls 1

topMethod · 0.80

Tested by

no test coverage detected