summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_town.hpp
diff options
context:
space:
mode:
authorYexo <yexo@openttd.org>2009-02-04 23:26:21 +0000
committerYexo <yexo@openttd.org>2009-02-04 23:26:21 +0000
commitb321130d9a831c88261ae3ed02686d1a1cda4085 (patch)
treee10fe107bf45eb727992bbee48cb0f0d8554fef1 /src/ai/api/ai_town.hpp
parentdf2a387fc3869ffd5d03181665591d954edcc0ee (diff)
downloadopenttd-b321130d9a831c88261ae3ed02686d1a1cda4085.tar.xz
(svn r15343) -Add [NoAI]: Add AITown::GetRoadLayout so AIs can get the road layout per town.
Diffstat (limited to 'src/ai/api/ai_town.hpp')
-rw-r--r--src/ai/api/ai_town.hpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/ai/api/ai_town.hpp b/src/ai/api/ai_town.hpp
index a4516f94b..02b806b4c 100644
--- a/src/ai/api/ai_town.hpp
+++ b/src/ai/api/ai_town.hpp
@@ -85,6 +85,18 @@ public:
};
/**
+ * Possible layouts for the roads in a town.
+ */
+ enum RoadLayout {
+ /* Order IS important, as it matches an in-game value */
+ ROAD_LAYOUT_ORIGINAL, ///< Original algorithm (min. 1 distance between roads).
+ ROAD_LAYOUT_BETTER_ROADS, ///< Extended original algorithm (min. 2 distance between roads).
+ ROAD_LAYOUT_2x2, ///< Geometric 2x2 grid algorithm
+ ROAD_LAYOUT_3x3, ///< Geometric 3x3 grid algorithm
+ ROAD_LAYOUT_INVALID = -1, ///< The layout for invalid towns.
+ };
+
+ /**
* Gets the maximum town index; there are no valid towns with a higher index.
* @return The maximum town index.
* @post Return value is always non-negative.
@@ -279,6 +291,13 @@ public:
* @return The noise that still can be added.
*/
static int GetAllowedNoise(TownID town_id);
+
+ /**
+ * Get the road layout for a town.
+ * @param town_id The town to get the road layout from.
+ * @return The RoadLayout for the town.
+ */
+ static RoadLayout GetRoadLayout(TownID town_id);
};
#endif /* AI_TOWN_HPP */