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

Method push

src/Battlescape/PathfindingOpenSet.cpp:77–86  ·  view source on GitHub ↗

* Places the node in the set. * If the node was already in the set, the previous entry is discarded. * It is the caller's responsibility to never re-add a node with a worse cost. * @param node A pointer to the node to add. */

Source from the content-addressed store, hash-verified

75 * @param node A pointer to the node to add.
76 */
77void PathfindingOpenSet::push(PathfindingNode *node)
78{
79 OpenSetEntry *entry = new OpenSetEntry;
80 entry->_node = node;
81 entry->_cost = node->getTUCost(false) + node->getTUGuess();
82 if (node->_openentry)
83 node->_openentry->_node = 0;
84 node->_openentry = entry;
85 _queue.push(entry);
86}
87
88
89}

Callers 3

aStarPathMethod · 0.80
findReachableMethod · 0.80

Calls 2

getTUGuessMethod · 0.80
getTUCostMethod · 0.45

Tested by

no test coverage detected