* 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. */
| 75 | * @param node A pointer to the node to add. |
| 76 | */ |
| 77 | void 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 | } |
no test coverage detected