src/ai/api/ai_tile.hpp
branchnoai
changeset 9617 df9cedf12aab
child 9619 6e81cec30a2b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ai/api/ai_tile.hpp	Fri May 04 22:59:59 2007 +0000
@@ -0,0 +1,48 @@
+/* $Id$ */
+
+/** @file ai_tile.hpp tile related functions */
+
+#ifndef AI_TILE_HPP
+#define AI_TILE_HPP
+
+#include "ai_abstractlist.hpp"
+
+/**
+ * Class that handles all tile related functions.
+ */
+class AITile : public AIObject {
+public:
+	/**
+	 * The name of the class, needed by several sub-processes.
+	 */
+	static const char *GetClassName() { return "AITile"; }
+
+	/**
+	 * Check if this tile is buildable (e.g.: no things on it that needs removing).
+	 * @note Road and rail are considered buildable.
+	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
+	 * @param tile the tile to check on.
+	 * @return true if it is buildable, false if not.
+	 */
+	static bool IsBuildable(TileIndex tile);
+
+	/**
+	 * Get the slope of a tile.
+	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
+	 * @param tile the tile to check on.
+	 * @return 0 means flat, others indicate internal state of slope.
+	 */
+	static int32 GetSlope(TileIndex tile);
+
+	/**
+	 * Check how much cargo this tile accepts.
+	 *  It creates a radius around the tile and adds up all acceptance of this
+	 *   cargo and returns that value.
+	 * @pre tile is always positive and smaller than AIMap::GetMapSize().
+	 * @param tile the tile to check on.
+	 * @return value below 8 means no acceptance; the more the better.
+	 */
+	static int32 GetCargoAcceptance(TileIndex tile, CargoID cargo_type);
+};
+
+#endif /* AI_TILE_HPP */