(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better noai
authortruebrain
Fri, 25 Apr 2008 15:56:58 +0000
branchnoai
changeset 10361 4cdffd48480f
parent 10360 3234cb59de55
child 10362 7fb36b849909
(svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
bin/ai/regression/regression.nut
bin/ai/regression/regression.txt
src/ai/api/ai_station.cpp
src/ai/api/ai_station.hpp
src/ai/api/ai_station.hpp.sq
src/ai/api/ai_town.cpp
src/ai/api/ai_town.hpp
src/ai/api/ai_town.hpp.sq
--- a/bin/ai/regression/regression.nut	Fri Apr 25 15:51:12 2008 +0000
+++ b/bin/ai/regression/regression.nut	Fri Apr 25 15:56:58 2008 +0000
@@ -667,8 +667,8 @@
 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
 		print("    " + i + " => " + list.GetValue(i));
 	}
-	list.Valuate(AIStation.IsWithinTownRadius, 0);
-	print("  IsWithinTownRadius(0) ListDump:");
+	list.Valuate(AIStation.IsWithinTownInfluence, 0);
+	print("  IsWithinTownInfluence(0) ListDump:");
 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
 		print("    " + i + " => " + list.GetValue(i));
 	}
@@ -991,8 +991,8 @@
 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
 		print("    " + i + " => " + list.GetValue(i));
 	}
-	list.Valuate(AITown.IsWithinTownRadius, AITown.GetLocation(0));
-	print("  IsWithinTownRadius(" + AITown.GetLocation(0) + ") ListDump:");
+	list.Valuate(AITown.IsWithinTownInfluence, AITown.GetLocation(0));
+	print("  IsWithinTownInfluence(" + AITown.GetLocation(0) + ") ListDump:");
 	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
 		print("    " + i + " => " + list.GetValue(i));
 	}
--- a/bin/ai/regression/regression.txt	Fri Apr 25 15:51:12 2008 +0000
+++ b/bin/ai/regression/regression.txt	Fri Apr 25 15:56:58 2008 +0000
@@ -6220,7 +6220,7 @@
     26 => 2458
     6 => 1088
     20 => 922
-  IsWithinTownRadius(15508) ListDump:
+  IsWithinTownInfluence(15508) ListDump:
     0 => 1
     27 => 0
     26 => 0
@@ -6454,7 +6454,7 @@
   DistanceSquareToTile(30000) ListDump:
     3 => 8818
     2 => 7058
-  IsWithinTownRadius(0) ListDump:
+  IsWithinTownInfluence(0) ListDump:
     3 => 0
     2 => 0
 
--- a/src/ai/api/ai_station.cpp	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_station.cpp	Fri Apr 25 15:56:58 2008 +0000
@@ -89,7 +89,7 @@
 	return AIMap::DistanceSquare(tile, GetLocation(station_id));
 }
 
-/* static */ bool AIStation::IsWithinTownRadius(StationID station_id, TownID town_id)
+/* static */ bool AIStation::IsWithinTownInfluence(StationID station_id, TownID town_id)
 {
-	return AITown::IsWithinTownRadius(town_id, GetLocation(station_id));
+	return AITown::IsWithinTownInfluence(town_id, GetLocation(station_id));
 }
--- a/src/ai/api/ai_station.hpp	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_station.hpp	Fri Apr 25 15:56:58 2008 +0000
@@ -125,11 +125,12 @@
 
 	/**
 	 * Find out if this station is within the rating influence of a town.
+	 *  Stations within the radius influence the rating of the town.
 	 * @param station_id The station to check.
 	 * @param town_id The town to check.
 	 * @return True if the tile is within the rating influence of the town.
 	 */
-	static bool IsWithinTownRadius(StationID station_id, TownID town_id);
+	static bool IsWithinTownInfluence(StationID station_id, TownID town_id);
 };
 
 DECLARE_ENUM_AS_BIT_SET(AIStation::StationType);
--- a/src/ai/api/ai_station.hpp.sq	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_station.hpp.sq	Fri Apr 25 15:56:58 2008 +0000
@@ -59,7 +59,7 @@
 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetCoverageRadius,          "GetCoverageRadius",          2, "xi");
 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, "xii");
 	SQAIStation.DefSQStaticMethod(engine, &AIStation::GetDistanceSquareToTile,    "GetDistanceSquareToTile",    3, "xii");
-	SQAIStation.DefSQStaticMethod(engine, &AIStation::IsWithinTownRadius,         "IsWithinTownRadius",         3, "xii");
+	SQAIStation.DefSQStaticMethod(engine, &AIStation::IsWithinTownInfluence,      "IsWithinTownInfluence",      3, "xii");
 
 	SQAIStation.PostRegister(engine);
 }
--- a/src/ai/api/ai_town.cpp	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_town.cpp	Fri Apr 25 15:56:58 2008 +0000
@@ -61,7 +61,7 @@
 	return AIMap::DistanceSquare(tile, GetLocation(town_id));
 }
 
-/* static */ bool AITown::IsWithinTownRadius(TownID town_id, TileIndex tile)
+/* static */ bool AITown::IsWithinTownInfluence(TownID town_id, TileIndex tile)
 {
 	const Town *t = ::GetTown(town_id);
 	return ((uint32)GetDistanceSquareToTile(town_id, tile) <= t->squared_town_zone_radius[0]);
--- a/src/ai/api/ai_town.hpp	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_town.hpp	Fri Apr 25 15:56:58 2008 +0000
@@ -83,11 +83,12 @@
 
 	/**
 	 * Find out if this tile is within the rating influence of a town.
+	 *  Stations on this tile influence the rating of the town.
 	 * @param town_id The town to check.
 	 * @param tile The tile to check.
 	 * @return True if the tile is within the rating influence of the town.
 	 */
-	static bool IsWithinTownRadius(TownID town_id, TileIndex tile);
+	static bool IsWithinTownInfluence(TownID town_id, TileIndex tile);
 };
 
 #endif /* AI_TOWN_HPP */
--- a/src/ai/api/ai_town.hpp.sq	Fri Apr 25 15:51:12 2008 +0000
+++ b/src/ai/api/ai_town.hpp.sq	Fri Apr 25 15:56:58 2008 +0000
@@ -26,7 +26,7 @@
 	SQAITown.DefSQStaticMethod(engine, &AITown::GetLocation,                "GetLocation",                2, "xi");
 	SQAITown.DefSQStaticMethod(engine, &AITown::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, "xii");
 	SQAITown.DefSQStaticMethod(engine, &AITown::GetDistanceSquareToTile,    "GetDistanceSquareToTile",    3, "xii");
-	SQAITown.DefSQStaticMethod(engine, &AITown::IsWithinTownRadius,         "IsWithinTownRadius",         3, "xii");
+	SQAITown.DefSQStaticMethod(engine, &AITown::IsWithinTownInfluence,      "IsWithinTownInfluence",      3, "xii");
 
 	SQAITown.PostRegister(engine);
 }