changeset 12975:dcff0ff964ae draft

(svn r17469) -Change: make the AI compatability wrapper not whine about deprecation (yet), but make it clear that the wrapper is running and what (slight) changes there are w.r.t. to 0.7.
author rubidium <rubidium@openttd.org>
date Mon, 07 Sep 2009 23:30:31 +0000
parents 9b86edff7a2e
children 29cdbe2ed4bc
files bin/ai/compat_0.7.nut bin/ai/compat_0.8.nut src/ai/api/ai_changelog.hpp
diffstat 3 files changed, 28 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/bin/ai/compat_0.7.nut
+++ b/bin/ai/compat_0.7.nut
@@ -1,8 +1,19 @@
 /* $Id$ */
 
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+AILog.Info("0.7 API compatability in effect:");
+AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
+AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
+AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
+
 AISign.GetMaxSignID <- function()
 {
-	AILog.Warning("AISign::GetMaxSignID is deprecated and will be removed soon, please use AISignList instead.");
 	local list = AISignList();
 	local max_id = 0;
 	foreach (id, d in list) {
@@ -13,7 +24,6 @@
 
 AITile.GetHeight <- function(tile)
 {
-	AILog.Warning("AITile::GetHeight is deprecated and will be removed soon, please use GetMinHeight/GetMaxHeight/GetCornerHeight instead.");
 	if (!AIMap.IsValidTile(tile)) return -1;
 
 	return AITile.GetCornerHeight(tile, AITile.CORNER_N);
@@ -21,8 +31,6 @@
 
 AIOrder.ChangeOrder <- function(vehicle_id, order_position, order_flags)
 {
-	AILog.Warning("AIOrder::ChangeOrder is deprecated and will be removed soon, please use AIOrder::SetOrderFlags instead.")
-
 	return AIOrder.SetOrderFlags(vehicle_id, order_position, order_flags);
 }
 
@@ -30,7 +38,6 @@
 
 AISubsidy.SourceIsTown <- function(subsidy_id)
 {
-	AILog.Warning("AISubsidy::SourceIsTown is deprecated and will be removed soon, please use AISubsidy::GetSourceType instead.");
 	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 
 	return AISubsidy.GetSourceType(subsidy_id) == AISubsidy.SPT_TOWN;
@@ -38,11 +45,9 @@
 
 AISubsidy.GetSource <- function(subsidy_id)
 {
-	AILog.Warning("AISubsidy::GetSource is deprecated and will be removed soon, please use AISubsidy::GetSourceIndex instead.");
 	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 
 	if (AISubsidy.IsAwarded(subsidy_id)) {
-		AILog.Error("AISubsidy::GetSource returned STATION_INVALID due to internal changes in the Subsidy logic.");
 		return AIBaseStation.STATION_INVALID;
 	}
 
@@ -51,7 +56,6 @@
 
 AISubsidy.DestinationIsTown <- function(subsidy_id)
 {
-	AILog.Warning("AISubsidy::DestinationIsTown is deprecated and will be removed soon, please use AISubsidy::GetDestinationType instead.");
 	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 
 	return AISubsidy.GetDestinationType(subsidy_id) == AISubsidy.SPT_TOWN;
@@ -59,11 +63,9 @@
 
 AISubsidy.GetDestination <- function(subsidy_id)
 {
-	AILog.Warning("AISubsidy::GetDestination is deprecated and will be removed soon, please use AISubsidy::GetDestinationIndex instead.");
 	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 
 	if (AISubsidy.IsAwarded(subsidy_id)) {
-		AILog.Error("AISubsidy::GetDestination returned STATION_INVALID due to internal changes in the Subsidy logic.");
 		return AIBaseStation.STATION_INVALID;
 	}
 
@@ -72,7 +74,5 @@
 
 AITown.GetMaxProduction <- function(town_id, cargo_id)
 {
-	AILog.Warning("AITown::GetMaxProduction is deprecated and will be removed soon, please use AITown::GetLastMonthProduction instead.");
-	AILog.Warning("Also note that behaviour of AITown::GetLastMonthProduction has slightly changed.");
 	return AITown.GetLastMonthProduction(town_id, cargo_id);
 }
--- a/bin/ai/compat_0.8.nut
+++ b/bin/ai/compat_0.8.nut
@@ -1,1 +1,8 @@
 /* $Id$ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
--- a/src/ai/api/ai_changelog.hpp
+++ b/src/ai/api/ai_changelog.hpp
@@ -30,16 +30,15 @@
  * \li AIIndustry::GetLastMonthTransportedPercentage
  *
  * API removals:
- * \li AIOrder::ChangeOrder
- * \li AISign::GetMaxSignID
- * \li AITile::GetHeight
- * \li AIBaseStation::WAYPOINT_INVALID
- * \li AISubsidy::SourceIsTown
- * \li AISubsidy::GetSource
- * \li AISubsidy::DestinationIsTown
- * \li AISubsidy::GetDestination
- * \li AITown::GetMaxProduction
- * \li AIWaypoint::WAYPOINT_INVALID
+ * \li AIOrder::ChangeOrder, use AIOrder::SetOrderFlags instead
+ * \li AISign::GetMaxSignID, use AISignList instead
+ * \li AITile::GetHeight, use AITile::GetMinHeight/GetMaxHeight/GetCornerHeight instead
+ * \li AISubsidy::SourceIsTown, use AISubsidy::GetSourceType instead
+ * \li AISubsidy::GetSource, use AISubsidy::GetSourceIndex instead
+ * \li AISubsidy::DestinationIsTown, use AISubsidy::GetDestinationType instead
+ * \li AISubsidy::GetDestination, use AISubsidy::GetDestinationIndex instead
+ * \li AITown::GetMaxProduction, use AITown::GetLastMonthProduction instead
+ * \li AIWaypoint::WAYPOINT_INVALID, use AIBaseStation::STATION_INVALID instead
  *
  * Other changes:
  * \li The GetName / SetName / GetLocation functions were moved from AIStation