]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/pathfinder.h
Increase default emerge queue limits and limit enqueue requests for active blocks.
[dragonfireclient.git] / src / pathfinder.h
index 31ea2f285a9ab7a1c0ad119e504c1055c344f93a..526aa0ee8d34f9b17f56e02378d01028eb3430e5 100644 (file)
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef PATHFINDER_H_
-#define PATHFINDER_H_
+#pragma once
 
 /******************************************************************************/
 /* Includes                                                                   */
@@ -30,7 +29,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 /* Forward declarations                                                       */
 /******************************************************************************/
 
-class ServerEnvironment;
+class NodeDefManager;
+class Map;
 
 /******************************************************************************/
 /* Typedefs and macros                                                        */
@@ -41,26 +41,24 @@ typedef enum {
        DIR_XM,
        DIR_ZP,
        DIR_ZM
-} path_directions;
+} PathDirections;
 
 /** List of supported algorithms */
 typedef enum {
-       DIJKSTRA,           /**< Dijkstra shortest path algorithm             */
-       A_PLAIN,            /**< A* algorithm using heuristics to find a path */
-       A_PLAIN_NP          /**< A* algorithm without prefetching of map data */
-} algorithm;
+       PA_DIJKSTRA,           /**< Dijkstra shortest path algorithm             */
+       PA_PLAIN,            /**< A* algorithm using heuristics to find a path */
+       PA_PLAIN_NP          /**< A* algorithm without prefetching of map data */
+} PathAlgorithm;
 
 /******************************************************************************/
 /* declarations                                                               */
 /******************************************************************************/
 
 /** c wrapper function to use from scriptapi */
-std::vector<v3s16> get_Path(ServerEnvironment* env,
-                                                       v3s16 source,
-                                                       v3s16 destination,
-                                                       unsigned int searchdistance,
-                                                       unsigned int max_jump,
-                                                       unsigned int max_drop,
-                                                       algorithm algo);
-
-#endif /* PATHFINDER_H_ */
+std::vector<v3s16> get_path(Map *map, const NodeDefManager *ndef,
+               v3s16 source,
+               v3s16 destination,
+               unsigned int searchdistance,
+               unsigned int max_jump,
+               unsigned int max_drop,
+               PathAlgorithm algo);