Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

pathfinder.h

00001 /***************************************************************************
00002                             pathfinder.h  -  description
00003                                 -------------------
00004     begin                : may 17th, 2004
00005     copyright            : (C) 2004-2006 by Duong-Khang NGUYEN
00006     email                : neoneurone @ users sourceforge net
00007 
00008     $Id: pathfinder.h 5 2006-06-17 23:53:07Z neoneurone $
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *   This program is free software; you can redistribute it and/or modify  *
00014  *   it under the terms of the GNU General Public License as published by  *
00015  *   the Free Software Foundation; either version 2 of the License, or     *
00016  *   any later version.                                                    *
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 

Generated on Sat Nov 11 10:21:10 2006 for OpenCity by  doxygen 1.4.2