00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _OPENCITY_PATHFINDER_H_
00021 #define _OPENCITY_PATHFINDER_H_ 1
00022
00023 #define PATHFINDER_NDEBUG 1 // Debugging off
00024
00025 #include "main.h"
00026
00027 #ifndef PATHFINDER_NDEBUG
00028 #define PATHFINDER_DEBUG( msg ) OPENCITY_DEBUG( msg )
00029 #else
00030 #define PATHFINDER_DEBUG( msg )
00031 #endif
00032
00033 #include <vector>
00034
00035
00036 class BuildingLayer;
00037 class Map;
00038 class Destination;
00039
00040
00043 class PathFinder {
00044 public:
00045 enum PATH_TYPE {
00046 OC_DISTANCE,
00047 OC_TRAFFIC
00048 };
00049
00050
00051 PathFinder(
00052 SDL_mutex* const mutex,
00053 BuildingLayer* const pblayer,
00054 Map* const map,
00055 const uint & rcuiCityWidth,
00056 const uint & rcuiCityHeight );
00057
00058 ~PathFinder();
00059
00060
00061 const bool
00062 findShortestPath(
00063 const uint & rcuiW1, const uint & rcuiH1,
00064 const uint & rcuiW2, const uint & rcuiH2,
00065 std::vector<Destination> & rvdest,
00066 const PATH_TYPE & enumType,
00067 uint uiMaxLength = 0xFFFFFFFF );
00068
00069
00070 private:
00071 SDL_mutex* pmutex;
00072 BuildingLayer* pbuildlayer;
00073 Map* pmap;
00074 uint uiWidth;
00075 uint uiHeight;
00076 };
00077
00078
00079 #endif
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109