void AStar::ReinsertNode(PathPlanNode* pNode) { GCC_ASSERT(pNode); for (PathPlanNodeList::iterator it = m_openSet.begin(); it != m_openSet.end(); ++it) { if (pNode == (*it)) { m_openSet.erase(it); InsertNode(pNode); return; } } // if we get here, the node was never in the open set to begin with GCC_WARNING("Attemping to reinsert node that was never in the open list"); InsertNode(pNode); }
//--------------------------------------------------------------------------------------------------------------------- // EventManager::VAddListener //--------------------------------------------------------------------------------------------------------------------- bool EventManager::VAddListener(const EventListenerDelegate& eventDelegate, const EventType& type) { GCC_LOG("Events", "Attempting to add delegate function for event type: " + ToStr(type, 16)); EventListenerList& eventListenerList = m_eventListeners[type]; // this will find or create the entry for (auto it = eventListenerList.begin(); it != eventListenerList.end(); ++it) { if (eventDelegate == (*it)) { GCC_WARNING("Attempting to double-register a delegate"); return false; } } eventListenerList.push_back(eventDelegate); GCC_LOG("Events", "Successfully added delegate for event type: " + ToStr(type, 16)); return true; }
PathPlanNode* AStar::AddToOpenSet(PathingNode* pNode, PathPlanNode* pPrevNode) { GCC_ASSERT(pNode); // create a new PathPlanNode if necessary PathingNodeToPathPlanNodeMap::iterator it = m_nodes.find(pNode); PathPlanNode* pThisNode = NULL; if (it == m_nodes.end()) { pThisNode = GCC_NEW PathPlanNode(pNode,pPrevNode,m_pGoalNode); m_nodes.insert(std::make_pair(pNode,pThisNode)); } else { GCC_WARNING("Adding existing PathPlanNode to open set"); pThisNode = it->second; pThisNode->SetClosed(false); } // now insert it into the priority queue InsertNode(pThisNode); return pThisNode; }
void BulletDebugDrawer::reportErrorWarning(const char* warningString) { GCC_WARNING(warningString); }