comparison engine/core/pathfinder/routepather/routepathersearch.cpp @ 378:64738befdf3b

bringing in the changes from the build_system_rework branch in preparation for the 0.3.0 release. This commit will require the Jan2010 devkit. Clients will also need to be modified to the new way to import fife.
author vtchill@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 11 Jan 2010 23:34:52 +0000
parents 0fd74235b34d
children
comparison
equal deleted inserted replaced
377:fe6fb0e0ed23 378:64738befdf3b
38 38
39 #include "routepathersearch.h" 39 #include "routepathersearch.h"
40 40
41 namespace FIFE { 41 namespace FIFE {
42 RoutePatherSearch::RoutePatherSearch(const int session_id, const Location& from, const Location& to, SearchSpace* searchSpace) 42 RoutePatherSearch::RoutePatherSearch(const int session_id, const Location& from, const Location& to, SearchSpace* searchSpace)
43 : m_destCoordInt(0), m_startCoordInt(0), m_next(0), m_to(to), m_from(from), m_sessionId(session_id), m_searchspace(searchSpace), m_status(search_status_incomplete){ 43 : m_to(to),
44 m_startCoordInt = m_searchspace->convertCoordToInt(from.getLayerCoordinates()); 44 m_from(from),
45 m_sessionId(session_id),
46 m_searchspace(searchSpace),
47 m_status(search_status_incomplete),
48 m_startCoordInt(searchSpace->convertCoordToInt(from.getLayerCoordinates())),
49 m_destCoordInt(searchSpace->convertCoordToInt(to.getLayerCoordinates())),
50 m_next(0),
51 m_heuristic(Heuristic::getHeuristic(searchSpace->getLayer()->getCellGrid()->getType()))
52 {
53 m_sortedfrontier.pushElement(PriorityQueue<int, float>::value_type(m_startCoordInt, 0.0f));
45 int max_index = m_searchspace->getMaxIndex(); 54 int max_index = m_searchspace->getMaxIndex();
46 m_destCoordInt = m_searchspace->convertCoordToInt(to.getLayerCoordinates());
47 m_sortedfrontier.pushElement(PriorityQueue<int, float>::value_type(m_startCoordInt, 0.0f));
48 m_spt.resize(max_index + 1, -1); 55 m_spt.resize(max_index + 1, -1);
49 m_sf.resize(max_index + 1, -1); 56 m_sf.resize(max_index + 1, -1);
50 m_gCosts.resize(max_index + 1, 0.0f); 57 m_gCosts.resize(max_index + 1, 0.0f);;
51 m_heuristic = Heuristic::getHeuristic(searchSpace->getLayer()->getCellGrid()->getType());
52 } 58 }
53 59
54 60
55 void RoutePatherSearch::updateSearch() { 61 void RoutePatherSearch::updateSearch() {
56 if(m_sortedfrontier.empty()) { 62 if(m_sortedfrontier.empty()) {