--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ai/api/ai_pathfinder_stupid.hpp Fri Jul 13 19:12:43 2007 +0000
@@ -0,0 +1,47 @@
+/* $Id$ */
+
+/** @file ai_pathfinder_stupid.hpp A really stupid pathfinder */
+
+#ifndef AI_PATHFINDER_STUPID_HPP
+#define AI_PATHFINDER_STUPID_HPP
+
+#include "ai_pathfinder.hpp"
+
+/**
+ * A stupid pathfinder. It first makes a straight line on the X-axis, than
+ * it does the same on the Y-axis. The result is rarely optimal, or connected.
+ */
+class AIPathFinderStupid : public AIPathFinder {
+public:
+ /**
+ * The name of the class, needed by several sub-processes.
+ */
+ static const char *GetClassName() { return "AIPathFinderStupid"; }
+
+ /**
+ * Custom constructor, to see for which type we are going to be a pathfinder.
+ */
+ AIPathFinderStupid(AIPathFinder::PathFinderType type) { this->type = type; }
+
+ void *FindRoute(AITileList *start, AITileList *end);
+ bool BuildRoute(void *result);
+ void FreeRoute(void *result);
+
+private:
+ AIPathFinder::PathFinderType type;
+
+ /**
+ * Internal storage of the pointer returned by FindRoute which can be given to BuildRoute.
+ */
+ struct Path {
+ TileIndex start;
+ TileIndex end;
+ };
+
+ /**
+ * Build the real route based on begin and end tile.
+ */
+ bool BuildRealRoute(TileIndex start, TileIndex end, bool continue_on_error);
+};
+
+#endif /* AI_PATHFINDER_HPP */