Changeset - r25961:cdb060badef0
[Not reviewed]
master
0 8 0
SamuXarick - 3 years ago 2021-09-14 20:06:55
43006711+SamuXarick@users.noreply.github.com
Feature: [AI/GS] Missing water related functions and objects (#8390)
8 files changed with 319 insertions and 61 deletions:
0 comments (0 inline, 0 general)
regression/regression/main.nut
Show inline comments
 
@@ -526,57 +526,60 @@ function Regression::Prices()
 
	print(" -Rail-");
 
	print("  0,BT_TRACK:    " + AIRail.GetBuildCost(0, AIRail.BT_TRACK));
 
	print("  0,BT_SIGNAL:   " + AIRail.GetBuildCost(0, AIRail.BT_SIGNAL));
 
	print("  0,BT_DEPOT:    " + AIRail.GetBuildCost(0, AIRail.BT_DEPOT));
 
	print("  0,BT_STATION:  " + AIRail.GetBuildCost(0, AIRail.BT_STATION));
 
	print("  0,BT_WAYPOINT: " + AIRail.GetBuildCost(0, AIRail.BT_WAYPOINT));
 
	print("  1,BT_TRACK:    " + AIRail.GetBuildCost(1, AIRail.BT_TRACK));
 
	print("  1,BT_SIGNAL:   " + AIRail.GetBuildCost(1, AIRail.BT_SIGNAL));
 
	print("  1,BT_DEPOT:    " + AIRail.GetBuildCost(1, AIRail.BT_DEPOT));
 
	print("  1,BT_STATION:  " + AIRail.GetBuildCost(1, AIRail.BT_STATION));
 
	print("  1,BT_WAYPOINT: " + AIRail.GetBuildCost(1, AIRail.BT_WAYPOINT));
 
	print(" -Road-");
 
	print("  ROADTYPE_ROAD,BT_ROAD:       " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_ROAD));
 
	print("  ROADTYPE_ROAD,BT_DEPOT:      " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_DEPOT));
 
	print("  ROADTYPE_ROAD,BT_BUS_STOP:   " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_BUS_STOP));
 
	print("  ROADTYPE_ROAD,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_TRUCK_STOP));
 
	print("  ROADTYPE_TRAM,BT_ROAD:       " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_ROAD));
 
	print("  ROADTYPE_TRAM,BT_DEPOT:      " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_DEPOT));
 
	print("  ROADTYPE_TRAM,BT_BUS_STOP:   " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_BUS_STOP));
 
	print("  ROADTYPE_TRAM,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_TRUCK_STOP));
 
	print(" -Water-");
 
	print("  BT_DOCK:  " + AIMarine.GetBuildCost(AIMarine.BT_DOCK));
 
	print("  BT_DEPOT: " + AIMarine.GetBuildCost(AIMarine.BT_DEPOT));
 
	print("  BT_BUOY:  " + AIMarine.GetBuildCost(AIMarine.BT_BUOY));
 
	print("  BT_LOCK:  " + AIMarine.GetBuildCost(AIMarine.BT_LOCK));
 
	print("  BT_CANAL: " + AIMarine.GetBuildCost(AIMarine.BT_CANAL));
 
	print(" -Tile-");
 
	print("  BT_FOUNDATION:   " + AITile.GetBuildCost(AITile.BT_FOUNDATION));
 
	print("  BT_TERRAFORM:    " + AITile.GetBuildCost(AITile.BT_TERRAFORM));
 
	print("  BT_BUILD_TREES:  " + AITile.GetBuildCost(AITile.BT_BUILD_TREES));
 
	print("  BT_CLEAR_GRASS:  " + AITile.GetBuildCost(AITile.BT_CLEAR_GRASS));
 
	print("  BT_CLEAR_ROUGH:  " + AITile.GetBuildCost(AITile.BT_CLEAR_ROUGH));
 
	print("  BT_CLEAR_ROCKY:  " + AITile.GetBuildCost(AITile.BT_CLEAR_ROCKY));
 
	print("  BT_CLEAR_FIELDS: " + AITile.GetBuildCost(AITile.BT_CLEAR_FIELDS));
 
	print("  BT_CLEAR_HOUSE:  " + AITile.GetBuildCost(AITile.BT_CLEAR_HOUSE));
 
	print("  BT_CLEAR_WATER:  " + AITile.GetBuildCost(AITile.BT_CLEAR_WATER));
 
}
 

	
 
function cost_callback(old_path, new_tile, new_direction, self) { if (old_path == null) return 0; return old_path.GetCost() + 1; }
 
function estimate_callback(tile, direction, goals, self) { return goals[0] - tile; }
 
function neighbours_callback(path, cur_tile, self) { return [[cur_tile + 1, 1]]; }
 
function check_direction_callback(tile, existing_direction, new_direction, self) { return false; }
 

	
 
function Regression::Group()
 
{
 
	print ("");
 
	print("--Group--");
 
	print("  SetAutoReplace():         " + AIGroup.SetAutoReplace(AIGroup.GROUP_ALL, 116, 117));
 
	print("  GetEngineReplacement():   " + AIGroup.GetEngineReplacement(AIGroup.GROUP_ALL, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	print("  AIRoad.BuildRoadDepot():  " + AIRoad.BuildRoadDepot(10000, 10001));
 
	local vehicle = AIVehicle.BuildVehicle(10000, 116);
 
	print("  AIVehicle.BuildVehicle(): " + vehicle);
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	local group = AIGroup.CreateGroup(AIVehicle.VT_ROAD, AIGroup.GROUP_INVALID);
 
	print("  CreateGroup():            " + group);
 
	print("  MoveVehicle():            " + AIGroup.MoveVehicle(group, vehicle));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(group, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_DEFAULT, 116));
 
@@ -898,48 +901,51 @@ function Regression::Marine()
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + AIWaypoint.GetLocation(i));
 
	}
 
	print("  HasWaypointType:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_RAIL) + "  " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_BUOY) + "  " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_ANY));
 
	}
 
	print("");
 

	
 
	print("  RemoveWaterDepot():   " + AIMarine.RemoveWaterDepot(28479));
 
	print("  RemoveDock():         " + AIMarine.RemoveDock(29253));
 
	print("  RemoveBuoy():         " + AIMarine.RemoveBuoy(28481));
 
	print("  RemoveLock():         " + AIMarine.RemoveLock(28487));
 
	print("  RemoveCanal():        " + AIMarine.RemoveCanal(32127));
 
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
 
	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
 
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
 
	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
 
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 

	
 
	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, 28480));
 
	print("  BuildDock():          " + AIMarine.BuildDock(29253, AIStation.STATION_JOIN_ADJACENT));
 
	print("  BuildBuoy():          " + AIMarine.BuildBuoy(28481));
 
	print("  BuildLock():          " + AIMarine.BuildLock(28487));
 
	print("  BuildCanal():         " + AIMarine.BuildCanal(28744));
 
}
 

	
 
function Regression::Order()
 
{
 
	print("");
 
	print("--Order--");
 
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(12));
 
	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(12, 1));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER | AIOrder.OF_UNLOAD));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER | AIOrder.OF_FULL_LOAD));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33417, AIOrder.OF_SERVICE_IF_NEEDED));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33417, AIOrder.OF_STOP_IN_DEPOT));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(0, AIOrder.OF_SERVICE_IF_NEEDED | AIOrder.OF_GOTO_NEAREST_DEPOT));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_LOAD_PERCENTAGE, AIOrder.CF_EQUALS));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_RELIABILITY, AIOrder.CF_IS_TRUE));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_REQUIRES_SERVICE, AIOrder.CF_IS_FALSE));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_AGE, AIOrder.CF_INVALID));
 
	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(12, 1));
 
	print("  IsGotoStationOrder():  " + AIOrder.IsGotoStationOrder(12, 1));
 
	print("  IsGotoDepotOrder():    " + AIOrder.IsGotoDepotOrder(12, 1));
 
	print("  IsGotoWaypointOrder(): " + AIOrder.IsGotoWaypointOrder(12, 1));
 
	print("  IsConditionalOrder():  " + AIOrder.IsConditionalOrder(12, 1));
 
	print("  IsCurrentOrderPartOfOrderList(): " + AIOrder.IsCurrentOrderPartOfOrderList(12));
 
@@ -1449,51 +1455,83 @@ function Regression::TileList()
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIRoad.IsRoadTile);
 
	list.KeepValue(1);
 
	print("  RoadTile():          done");
 
	print("  KeepValue(1):        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIRoad.GetNeighbourRoadCount);
 
	list.KeepValue(1);
 
	print("  NeighbourRoadCount():done");
 
	print("  KeepValue(1):        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.AddRectangle(54421 - 256 * 2, 256 * 2 + 54421 + 8);
 
	list.AddRectangle(0x6F3F, 0x7248);
 
	list.Valuate(AITile.IsWaterTile);
 
	print("  Water():             done");
 
	print("  IsWaterTile():       done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsSeaTile);
 
	print("  IsSeaTile():         done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsRiverTile);
 
	print("  IsRiverTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIMarine.IsCanalTile);
 
	print("  IsCanalTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsCoastTile);
 
	print("  IsCoastTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AITileList_IndustryAccepting(0, 3);
 
	print("");
 
	print("--TileList_IndustryAccepting--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AITile.GetCargoAcceptance, 3, 1, 1, 3);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AITileList_IndustryProducing(1, 3);
 
	print("");
 
	print("--TileList_IndustryProducing--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AITile.GetCargoProduction, 7, 1, 1, 3);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
regression/regression/result.txt
Show inline comments
 
@@ -7344,83 +7344,89 @@ ERROR: IsEnd() is invalid as Begin() is 
 
  IsLockTile():         true
 
  IsCanalTile():        true
 
  GetBankBalance():     1999964680
 

	
 
--AIWaypointList(BUOY)--
 
  Count():             1
 
  Location ListDump:
 
    28481
 
  HasWaypointType:
 
    false  true  false
 

	
 
  RemoveWaterDepot():   true
 
  RemoveDock():         true
 
  RemoveBuoy():         true
 
  RemoveLock():         true
 
  RemoveCanal():        true
 
  IsWaterDepotTile():   false
 
  IsDockTile():         false
 
  IsBuoyTile():         false
 
  IsLockTile():         false
 
  IsCanalTile():        false
 
  GetBankBalance():     1999959285
 
  BuildWaterDepot():    true
 
  BuildDock():          true
 
  BuildBuoy():          true
 
  BuildLock():          true
 
  BuildCanal():         true
 

	
 
--Prices--
 
 -Rail-
 
  0,BT_TRACK:    75
 
  0,BT_SIGNAL:   48
 
  0,BT_DEPOT:    450
 
  0,BT_STATION:  285
 
  0,BT_WAYPOINT: 450
 
  1,BT_TRACK:    -1
 
  1,BT_SIGNAL:   -1
 
  1,BT_DEPOT:    -1
 
  1,BT_STATION:  -1
 
  1,BT_WAYPOINT: -1
 
 -Road-
 
  ROADTYPE_ROAD,BT_ROAD:       71
 
  ROADTYPE_ROAD,BT_DEPOT:      375
 
  ROADTYPE_ROAD,BT_BUS_STOP:   150
 
  ROADTYPE_ROAD,BT_TRUCK_STOP: 150
 
  ROADTYPE_TRAM,BT_ROAD:       -1
 
  ROADTYPE_TRAM,BT_DEPOT:      -1
 
  ROADTYPE_TRAM,BT_BUS_STOP:   -1
 
  ROADTYPE_TRAM,BT_TRUCK_STOP: -1
 
 -Water-
 
  BT_DOCK:  262
 
  BT_DEPOT: 525
 
  BT_BUOY:  262
 
  BT_LOCK:  5625
 
  BT_CANAL: 3750
 
 -Tile-
 
  BT_FOUNDATION:   187
 
  BT_TERRAFORM:    187
 
  BT_BUILD_TREES:  15
 
  BT_CLEAR_GRASS:  15
 
  BT_CLEAR_ROUGH:  30
 
  BT_CLEAR_ROCKY:  150
 
  BT_CLEAR_FIELDS: 375
 
  BT_CLEAR_HOUSE:  1200
 
  BT_CLEAR_WATER:  7500
 

	
 
--Rail--
 
    IsRailTile():                  false
 
    BuildRailTrack():              true
 
    BuildSignal():                 true
 
    RemoveRailTrack():             false
 
    RemoveRailTrack():             true
 
    BuildRail():                   true
 
    HasTransportType():            true
 
    HasTransportType():            false
 
    RemoveRail():                  true
 
    HasTransportType():            false
 
    HasTransportType():            false
 
    BuildRailTrack():              true
 
    RemoveRailTrack():             false
 
    RemoveRailTrack():             true
 
    BuildRail():                   true
 
    HasTransportType():            true
 
    HasTransportType():            false
 
    RemoveRail():                  true
 
    HasTransportType():            true
 
    HasTransportType():            false
 
    BuildRailTrack():              true
 
    HasTransportType():            true
 
@@ -8429,96 +8435,263 @@ ERROR: IsEnd() is invalid as Begin() is 
 
  ListDump:
 
    41897 => 29
 
    41385 => 26
 
    41384 => 26
 
    42153 => 25
 
    41641 => 23
 
    41899 => 17
 
    41898 => 17
 
    41387 => 17
 
    41386 => 17
 
    41643 => 14
 
    41642 => 14
 
    42411 => 13
 
    42410 => 13
 
    42155 => 13
 
    42154 => 13
 
  RoadTile():          done
 
  KeepValue(1):        done
 
  Count():             0
 
  ListDump:
 
  NeighbourRoadCount():done
 
  KeepValue(1):        done
 
  Count():             0
 
  ListDump:
 
  Water():             done
 
  Count():             45
 
  IsWaterTile():       done
 
  Count():             40
 
  ListDump:
 
    29251 => 1
 
    29250 => 1
 
    29249 => 1
 
    29248 => 1
 
    29247 => 1
 
    28996 => 1
 
    28995 => 1
 
    28994 => 1
 
    28993 => 1
 
    28992 => 1
 
    28991 => 1
 
    28744 => 1
 
    28741 => 1
 
    28740 => 1
 
    28739 => 1
 
    28738 => 1
 
    28737 => 1
 
    28736 => 1
 
    28735 => 1
 
    28488 => 1
 
    28487 => 1
 
    28486 => 1
 
    28485 => 1
 
    28484 => 1
 
    28483 => 1
 
    28482 => 1
 
    28480 => 1
 
    28479 => 1
 
    29256 => 0
 
    29255 => 0
 
    29254 => 0
 
    29253 => 0
 
    29252 => 0
 
    29000 => 0
 
    28999 => 0
 
    28998 => 0
 
    28997 => 0
 
    28743 => 0
 
    28742 => 0
 
    28481 => 0
 
  IsSeaTile():         done
 
  Count():             40
 
  ListDump:
 
    29251 => 1
 
    29250 => 1
 
    29249 => 1
 
    29248 => 1
 
    29247 => 1
 
    28996 => 1
 
    28995 => 1
 
    28994 => 1
 
    28993 => 1
 
    28992 => 1
 
    28991 => 1
 
    28741 => 1
 
    28740 => 1
 
    28739 => 1
 
    28738 => 1
 
    28737 => 1
 
    28736 => 1
 
    28735 => 1
 
    28485 => 1
 
    28484 => 1
 
    28483 => 1
 
    28482 => 1
 
    29256 => 0
 
    29255 => 0
 
    29254 => 0
 
    29253 => 0
 
    29252 => 0
 
    29000 => 0
 
    28999 => 0
 
    28998 => 0
 
    28997 => 0
 
    28744 => 0
 
    28743 => 0
 
    28742 => 0
 
    28488 => 0
 
    28487 => 0
 
    28486 => 0
 
    28481 => 0
 
    28480 => 0
 
    28479 => 0
 
  IsRiverTile()        done
 
  Count():             40
 
  ListDump:
 
    54941 => 1
 
    54940 => 1
 
    54939 => 1
 
    54938 => 1
 
    54937 => 1
 
    54936 => 1
 
    54935 => 1
 
    54934 => 1
 
    54933 => 1
 
    54685 => 1
 
    54684 => 1
 
    54683 => 1
 
    54682 => 1
 
    54681 => 1
 
    54680 => 1
 
    54679 => 1
 
    54678 => 1
 
    54677 => 1
 
    54429 => 1
 
    54428 => 1
 
    54427 => 1
 
    54426 => 1
 
    54425 => 1
 
    54424 => 1
 
    54423 => 1
 
    54422 => 1
 
    54421 => 1
 
    54173 => 1
 
    54172 => 1
 
    54171 => 1
 
    54170 => 1
 
    54169 => 1
 
    54168 => 0
 
    54167 => 0
 
    54166 => 0
 
    54165 => 0
 
    53917 => 0
 
    53916 => 0
 
    53915 => 0
 
    53914 => 0
 
    53913 => 0
 
    53912 => 0
 
    53911 => 0
 
    53910 => 0
 
    53909 => 0
 
    29256 => 0
 
    29255 => 0
 
    29254 => 0
 
    29253 => 0
 
    29252 => 0
 
    29251 => 0
 
    29250 => 0
 
    29249 => 0
 
    29248 => 0
 
    29247 => 0
 
    29000 => 0
 
    28999 => 0
 
    28998 => 0
 
    28997 => 0
 
    28996 => 0
 
    28995 => 0
 
    28994 => 0
 
    28993 => 0
 
    28992 => 0
 
    28991 => 0
 
    28744 => 0
 
    28743 => 0
 
    28742 => 0
 
    28741 => 0
 
    28740 => 0
 
    28739 => 0
 
    28738 => 0
 
    28737 => 0
 
    28736 => 0
 
    28735 => 0
 
    28488 => 0
 
    28487 => 0
 
    28486 => 0
 
    28485 => 0
 
    28484 => 0
 
    28483 => 0
 
    28482 => 0
 
    28481 => 0
 
    28480 => 0
 
    28479 => 0
 
  IsCanalTile()        done
 
  Count():             40
 
  ListDump:
 
    28744 => 1
 
    29256 => 0
 
    29255 => 0
 
    29254 => 0
 
    29253 => 0
 
    29252 => 0
 
    29251 => 0
 
    29250 => 0
 
    29249 => 0
 
    29248 => 0
 
    29247 => 0
 
    29000 => 0
 
    28999 => 0
 
    28998 => 0
 
    28997 => 0
 
    28996 => 0
 
    28995 => 0
 
    28994 => 0
 
    28993 => 0
 
    28992 => 0
 
    28991 => 0
 
    28743 => 0
 
    28742 => 0
 
    28741 => 0
 
    28740 => 0
 
    28739 => 0
 
    28738 => 0
 
    28737 => 0
 
    28736 => 0
 
    28735 => 0
 
    28488 => 0
 
    28487 => 0
 
    28486 => 0
 
    28485 => 0
 
    28484 => 0
 
    28483 => 0
 
    28482 => 0
 
    28481 => 0
 
    28480 => 0
 
    28479 => 0
 
  IsCoastTile()        done
 
  Count():             40
 
  ListDump:
 
    28998 => 1
 
    28997 => 1
 
    28743 => 1
 
    28742 => 1
 
    29256 => 0
 
    29255 => 0
 
    29254 => 0
 
    29253 => 0
 
    29252 => 0
 
    29251 => 0
 
    29250 => 0
 
    29249 => 0
 
    29248 => 0
 
    29247 => 0
 
    29000 => 0
 
    28999 => 0
 
    28996 => 0
 
    28995 => 0
 
    28994 => 0
 
    28993 => 0
 
    28992 => 0
 
    28991 => 0
 
    28744 => 0
 
    28741 => 0
 
    28740 => 0
 
    28739 => 0
 
    28738 => 0
 
    28737 => 0
 
    28736 => 0
 
    28735 => 0
 
    28488 => 0
 
    28487 => 0
 
    28486 => 0
 
    28485 => 0
 
    28484 => 0
 
    28483 => 0
 
    28482 => 0
 
    28481 => 0
 
    28480 => 0
 
    28479 => 0
 

	
 
--TileList_IndustryAccepting--
 
  Count():             47
 
  Location ListDump:
 
    21234 => 16
 
    21233 => 16
 
    21232 => 16
 
    21231 => 16
 
    21230 => 16
 
    21229 => 16
 
    20978 => 16
 
    20977 => 16
 
    20976 => 16
 
    20975 => 16
 
    20974 => 16
 
    20973 => 16
 
    20722 => 16
 
    20718 => 16
 
    20717 => 16
 
    20466 => 16
 
    20462 => 16
 
    20461 => 16
 
    20210 => 16
 
    20206 => 16
 
@@ -9078,151 +9251,151 @@ ERROR: IsEnd() is invalid as Begin() is 
 
  --Accounting--
 
    GetCosts():         11894
 
    Should be:          11894
 
    ResetCosts():       (null : 0x00000000)
 
  SellVehicle(13):      true
 
  IsInDepot():          true
 
  IsStoppedInDepot():   true
 
  StartStopVehicle():   true
 
  IsInDepot():          false
 
  IsStoppedInDepot():   false
 
  SendVehicleToDepot(): true
 
  IsInDepot():          false
 
  IsStoppedInDepot():   false
 
  --Accounting--
 
    GetCosts():         -5947
 
    Should be:          -5947
 
  GetName():            Road Vehicle #1
 
  SetName():            true
 
  GetName():            MyVehicleName
 
  CloneVehicle():       13
 
  --VehicleData--
 
    GetLocation():       33417
 
    GetEngineType():     153
 
    GetUnitNumber():     1
 
    GetAge():            0
 
    GetAge():            1
 
    GetMaxAge():         5490
 
    GetAgeLeft():        5490
 
    GetAgeLeft():        5489
 
    GetCurrentSpeed():   7
 
    GetRunningCost():    421
 
    GetProfitThisYear(): 0
 
    GetProfitThisYear(): -1
 
    GetProfitLastYear(): 0
 
    GetCurrentValue():   5947
 
    GetVehicleType():    1
 
    GetRoadType():       0
 
    GetCapacity():       12
 
    GetCargoLoad():      0
 
    IsInDepot():         false
 
    GetNumWagons():      1
 
    GetWagonEngineType(): 153
 
    GetWagonAge():       0
 
    GetWagonAge():       1
 
    GetLength():         8
 
  GetOwner():           1
 
  BuildVehicle():       14
 
  IsValidVehicle(14):   true
 
  IsInDepot(14):        true
 
  IsStoppedInDepot(14): true
 
  IsValidVehicle(15):   false
 
  IsInDepot(15):        false
 
  IsStoppedInDepot(15): false
 
  BuildVehicle():       16
 
  IsValidVehicle(16):   true
 
  IsInDepot(16):        true
 
  IsStoppedInDepot(16): true
 
  BuildRailDepot():     true
 
  BuildVehicle():       17
 
  BuildVehicle():       18
 
  BuildVehicle():       19
 
  IsValidVehicle(17):   true
 
  IsValidVehicle(18):   true
 
  IsValidVehicle(19):   false
 
  MoveWagonChain():     true
 
  GetNumWagons():       3
 
  GetLength():          24
 
  GetWagonEngineType(): 9
 
  GetWagonAge():        1
 
  GetWagonAge():        0
 
  GetWagonEngineType(): 27
 
  GetWagonAge():        1
 
  GetWagonAge():        0
 
  GetWagonEngineType(): 27
 
  GetWagonAge():        0
 
  GetWagonEngineType(): 65535
 
  GetWagonAge():        -1
 
  --Refit--
 
    GetBuildWithRefitCapacity(): -1
 
    GetBuildWithRefitCapacity(): 0
 
    GetBuildWithRefitCapacity(): 160
 
    BuildVehicleWithRefit():     20
 
    GetCapacity():               160
 
    GetCapacity():               0
 
    GetRefitCapacity():          160
 
    RefitVehicle():              true
 
    GetCapacity():               0
 
    GetCapacity():               160
 
    SellVehicle():               true
 
  --Errors--
 
    RefitVehicle():        false
 
    GetLastErrorString():  ERR_VEHICLE_NOT_IN_DEPOT
 
    SellVehicle():         false
 
    GetLastErrorString():  ERR_VEHICLE_NOT_IN_DEPOT
 
    SendVehicleToDepot():  false
 
    GetLastErrorString():  ERR_UNKNOWN
 

	
 
--VehicleList--
 
  Count():             5
 
  Location ListDump:
 
    13 => 33417
 
    12 => 33417
 
    14 => 32119
 
    16 => 28479
 
    17 => 10008
 
  EngineType ListDump:
 
    14 => 219
 
    16 => 204
 
    13 => 153
 
    12 => 153
 
    17 => 9
 
  UnitNumber ListDump:
 
    13 => 2
 
    17 => 1
 
    16 => 1
 
    14 => 1
 
    12 => 1
 
  Age ListDump:
 
    17 => 1
 
    16 => 1
 
    14 => 1
 
    13 => 1
 
    12 => 1
 
    17 => 0
 
    16 => 0
 
    14 => 0
 
  MaxAge ListDump:
 
    16 => 10980
 
    14 => 10980
 
    17 => 7320
 
    13 => 5490
 
    12 => 5490
 
  AgeLeft ListDump:
 
    16 => 10979
 
    14 => 10979
 
    17 => 7319
 
    16 => 10980
 
    14 => 10980
 
    17 => 7320
 
    13 => 5489
 
    12 => 5489
 
  CurrentSpeed ListDump:
 
    12 => 27
 
    17 => 0
 
    16 => 0
 
    14 => 0
 
    13 => 0
 
  RunningCost ListDump:
 
    14 => 2756
 
    17 => 2296
 
    16 => 2296
 
    13 => 421
 
    12 => 421
 
  ProfitThisYear ListDump:
 
    17 => 0
 
    16 => 0
 
    14 => 0
 
    13 => 0
 
    12 => -1
 
  ProfitLastYear ListDump:
 
    17 => 0
 
    16 => 0
 
    14 => 0
src/script/api/ai_changelog.hpp
Show inline comments
 
/*
 
 * 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/>.
 
 */
 

	
 
/**
 
 * @file ai_changelog.hpp Lists all changes / additions to the API.
 
 *
 
 * Only new / renamed / deleted api functions will be listed here. A list of
 
 * bug fixes can be found in the normal changelog. Note that removed API
 
 * functions may still be available if you return an older API version
 
 * in GetAPIVersion() in info.nut.
 
 *
 
 * \b 12.0
 
 *
 
 * This version is not yet released. The following changes are not set in stone yet.
 
 *
 
 * API additions:
 
 * \li AINewGRF
 
 * \li AINewGRFList
 
 * \li AIGroup::GetNumVehicles
 
 * \li AIMarine::BT_LOCK
 
 * \li AIMarine::BT_CANAL
 
 * \li AITile::IsSeaTile
 
 * \li AITile::IsRiverTile
 
 * \li AITile::BT_CLEAR_WATER
 
 *
 
 * \b 1.11.0
 
 *
 
 * API additions:
 
 * \li AICargo::GetName
 
 * \li AIPriorityQueue
 
 *
 
 * Other changes:
 
 * \li AIVehicle::CloneVehicle now correctly returns estimate when short on cash
 
 *
 
 * \b 1.10.0
 
 *
 
 * API additions:
 
 * \li AIGroup::SetPrimaryColour
 
 * \li AIGroup::SetSecondaryColour
 
 * \li AIGroup::GetPrimaryColour
 
 * \li AIGroup::GetSecondaryColour
 
 * \li AIVehicle::BuildVehicleWithRefit
 
 * \li AIVehicle::GetBuildWithRefitCapacity
 
 * \li AIRoad::GetName
 
 * \li AIRoad::RoadVehCanRunOnRoad
 
 * \li AIRoad::RoadVehHasPowerOnRoad
 
 * \li AIRoad::ConvertRoadType
 
 * \li AIRoad::GetMaxSpeed
src/script/api/game_changelog.hpp
Show inline comments
 
/*
 
 * 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/>.
 
 */
 

	
 
/**
 
 * @file game_changelog.hpp Lists all changes / additions to the API.
 
 *
 
 * Only new / renamed / deleted api functions will be listed here. A list of
 
 * bug fixes can be found in the normal changelog. Note that removed API
 
 * functions may still be available if you return an older API version
 
 * in GetAPIVersion() in info.nut.
 
 *
 
 * \b 12.0
 
 *
 
 * This version is not yet released. The following changes are not set in stone yet.
 
 *
 
 * API additions:
 
 * \li GSNewGRF
 
 * \li GSNewGRFList
 
 * \li GSMarine::BT_LOCK
 
 * \li GSMarine::BT_CANAL
 
 * \li GSTile::IsSeaTile
 
 * \li GSTile::IsRiverTile
 
 * \li GSTile::BT_CLEAR_WATER
 
 *
 
 * \b 1.11.0
 
 *
 
 * API additions:
 
 * \li GSCargo::GetName
 
 * \li GSEventStoryPageButtonClick
 
 * \li GSEventStoryPageTileSelect
 
 * \li GSEventStoryPageVehicleSelect
 
 * \li GSIndustry::GetCargoLastAcceptedDate
 
 * \li GSIndustry::GetControlFlags
 
 * \li GSIndustry::GetExclusiveConsumer
 
 * \li GSIndustry::GetExclusiveSupplier
 
 * \li GSIndustry::GetLastProductionYear
 
 * \li GSIndustry::SetControlFlags
 
 * \li GSIndustry::SetExclusiveConsumer
 
 * \li GSIndustry::SetExclusiveSupplier
 
 * \li GSIndustry::SetText
 
 * \li GSStoryPage::MakePushButtonReference
 
 * \li GSStoryPage::MakeTileButtonReference
 
 * \li GSStoryPage::MakeVehicleButtonReference
 
 * \li GSPriorityQueue
 
 *
 
 * Other changes:
 
 * \li GSCompany::ChangeBankBalance takes one extra parameter to refer to a location to show text effect on
src/script/api/script_marine.cpp
Show inline comments
 
@@ -146,27 +146,29 @@
 
/* static */ bool ScriptMarine::RemoveLock(TileIndex tile)
 
{
 
	EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
 
	EnforcePrecondition(false, ::IsValidTile(tile));
 
	EnforcePrecondition(false, IsLockTile(tile));
 

	
 
	return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
 
}
 

	
 
/* static */ bool ScriptMarine::RemoveCanal(TileIndex tile)
 
{
 
	EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
 
	EnforcePrecondition(false, ::IsValidTile(tile));
 
	EnforcePrecondition(false, IsCanalTile(tile));
 

	
 
	return ScriptObject::DoCommand(tile, 0, 0, CMD_LANDSCAPE_CLEAR);
 
}
 

	
 
/* static */ Money ScriptMarine::GetBuildCost(BuildType build_type)
 
{
 
	switch (build_type) {
 
		case BT_DOCK:  return ::GetPrice(PR_BUILD_STATION_DOCK, 1, nullptr);
 
		case BT_DEPOT: return ::GetPrice(PR_BUILD_DEPOT_SHIP, 1, nullptr);
 
		case BT_BUOY:  return ::GetPrice(PR_BUILD_WAYPOINT_BUOY, 1, nullptr);
 
		case BT_LOCK:  return ::GetPrice(PR_BUILD_LOCK, 1, nullptr);
 
		case BT_CANAL: return ::GetPrice(PR_BUILD_CANAL, 1, nullptr);
 
		default: return -1;
 
	}
 
}
src/script/api/script_marine.hpp
Show inline comments
 
@@ -15,48 +15,50 @@
 
/**
 
 * Class that handles all marine related functions.
 
 * @api ai game
 
 */
 
class ScriptMarine : public ScriptObject {
 
public:
 
	/**
 
	 * All marine related error messages.
 
	 */
 
	enum ErrorMessages {
 
		/** Base for marine related errors */
 
		ERR_MARINE_BASE = ScriptError::ERR_CAT_MARINE << ScriptError::ERR_CAT_BIT_SIZE,
 

	
 
		/** Infrastructure must be built on water */
 
		ERR_MARINE_MUST_BE_BUILT_ON_WATER,                  // [STR_ERROR_MUST_BE_BUILT_ON_WATER]
 
	};
 

	
 
	/**
 
	 * Types of water-related objects in the game.
 
	 */
 
	enum BuildType {
 
		BT_DOCK,  ///< Build a dock
 
		BT_DEPOT, ///< Build a ship depot
 
		BT_BUOY,  ///< Build a buoy
 
		BT_LOCK,  ///< Build a lock
 
		BT_CANAL, ///< Build a canal
 
	};
 

	
 
	/**
 
	 * Checks whether the given tile is actually a tile with a water depot.
 
	 * @param tile The tile to check.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile has a water depot.
 
	 */
 
	static bool IsWaterDepotTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a tile with a dock.
 
	 * @param tile The tile to check.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile has a dock.
 
	 */
 
	static bool IsDockTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a tile with a buoy.
 
	 * @param tile The tile to check.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile has a buoy.
 
	 */
src/script/api/script_tile.cpp
Show inline comments
 
@@ -37,48 +37,62 @@
 
			if (!HasExactlyOneBit(::GetRoadBits(tile, RTT_ROAD))) return false;
 
			if (::IsRoadOwner(tile, RTT_ROAD, OWNER_TOWN)) return true;
 
			if (::IsRoadOwner(tile, RTT_ROAD, ScriptObject::GetCompany())) return true;
 
			return false;
 
	}
 
}
 

	
 
/* static */ bool ScriptTile::IsBuildableRectangle(TileIndex tile, uint width, uint height)
 
{
 
	/* Check whether we can extract valid X and Y */
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	uint tx = ScriptMap::GetTileX(tile);
 
	uint ty = ScriptMap::GetTileY(tile);
 

	
 
	for (uint x = tx; x < width + tx; x++) {
 
		for (uint y = ty; y < height + ty; y++) {
 
			if (!IsBuildable(ScriptMap::GetTileIndex(x, y))) return false;
 
		}
 
	}
 

	
 
	return true;
 
}
 

	
 
/* static */ bool ScriptTile::IsSeaTile(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	return ::IsTileType(tile, MP_WATER) && ::IsSea(tile);
 
}
 

	
 
/* static */ bool ScriptTile::IsRiverTile(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	return ::IsTileType(tile, MP_WATER) && ::IsRiver(tile);
 
}
 

	
 
/* static */ bool ScriptTile::IsWaterTile(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	return ::IsTileType(tile, MP_WATER) && !::IsCoast(tile);
 
}
 

	
 
/* static */ bool ScriptTile::IsCoastTile(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	return (::IsTileType(tile, MP_WATER) && ::IsCoast(tile)) ||
 
		(::IsTileType(tile, MP_TREES) && ::GetTreeGround(tile) == TREE_GROUND_SHORE);
 
}
 

	
 
/* static */ bool ScriptTile::IsStationTile(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return false;
 

	
 
	return ::IsTileType(tile, MP_STATION);
 
}
 

	
 
/* static */ bool ScriptTile::IsSteepSlope(Slope slope)
 
{
 
@@ -299,27 +313,28 @@
 
	return town->index;
 
}
 

	
 
/* static */ TownID ScriptTile::GetClosestTown(TileIndex tile)
 
{
 
	if (!::IsValidTile(tile)) return INVALID_TOWN;
 

	
 
	Town *town = ::ClosestTownFromTile(tile, UINT_MAX);
 
	if (town == nullptr) return INVALID_TOWN;
 

	
 
	return town->index;
 
}
 

	
 
/* static */ Money ScriptTile::GetBuildCost(BuildType build_type)
 
{
 
	switch (build_type) {
 
		case BT_FOUNDATION:   return ::GetPrice(PR_BUILD_FOUNDATION, 1, nullptr);
 
		case BT_TERRAFORM:    return ::GetPrice(PR_TERRAFORM, 1, nullptr);
 
		case BT_BUILD_TREES:  return ::GetPrice(PR_BUILD_TREES, 1, nullptr);
 
		case BT_CLEAR_GRASS:  return ::GetPrice(PR_CLEAR_GRASS, 1, nullptr);
 
		case BT_CLEAR_ROUGH:  return ::GetPrice(PR_CLEAR_ROUGH, 1, nullptr);
 
		case BT_CLEAR_ROCKY:  return ::GetPrice(PR_CLEAR_ROCKS, 1, nullptr);
 
		case BT_CLEAR_FIELDS: return ::GetPrice(PR_CLEAR_FIELDS, 1, nullptr);
 
		case BT_CLEAR_HOUSE:  return ::GetPrice(PR_CLEAR_HOUSE, 1, nullptr);
 
		case BT_CLEAR_WATER:  return ::GetPrice(PR_CLEAR_WATER, 1, nullptr);
 
		default: return -1;
 
	}
 
}
src/script/api/script_tile.hpp
Show inline comments
 
@@ -98,92 +98,110 @@ public:
 
	 */
 
	enum TransportType {
 
		/* Note: these values represent part of the in-game TransportType enum */
 
		TRANSPORT_RAIL    =  ::TRANSPORT_RAIL,  ///< Tile with rail.
 
		TRANSPORT_ROAD    =  ::TRANSPORT_ROAD,  ///< Tile with road.
 
		TRANSPORT_WATER   =  ::TRANSPORT_WATER, ///< Tile with navigable waterways.
 
		TRANSPORT_AIR     =  ::TRANSPORT_AIR,   ///< Tile with airport.
 

	
 
		/* Custom added value, only valid for this API */
 
		TRANSPORT_INVALID = -1, ///< Tile without any transport type.
 
	};
 

	
 
	/**
 
	 * Get the base cost for building/clearing several things.
 
	 */
 
	enum BuildType {
 
		BT_FOUNDATION,   ///< Build a foundation under something
 
		BT_TERRAFORM,    ///< Terraform
 
		BT_BUILD_TREES,  ///< Build trees
 
		BT_CLEAR_GRASS,  ///< Clear a tile with just grass
 
		BT_CLEAR_ROUGH,  ///< Clear a rough tile
 
		BT_CLEAR_ROCKY,  ///< Clear a tile with rocks
 
		BT_CLEAR_FIELDS, ///< Clear a tile with farm fields
 
		BT_CLEAR_HOUSE,  ///< Clear a tile with a house
 
		BT_CLEAR_WATER,  ///< Clear a tile with either river or sea
 
	};
 

	
 
	/**
 
	 * The types of terrain a tile can have.
 
	 *
 
	 * @note When a desert or rainforest tile are changed, their terrain type will remain the same. In other words, a sea tile can be of the desert terrain type.
 
	 * @note The snow terrain type can change to the normal terrain type and vice versa based on landscaping or variable snow lines from NewGRFs.
 
	 */
 
	enum TerrainType {
 
		TERRAIN_NORMAL,     ///< A normal tile (default); not desert, rainforest or snow.
 
		TERRAIN_DESERT,     ///< A tile in the desert (manually set in in scenarios, below certain height and certain distance from water in random games).
 
		TERRAIN_RAINFOREST, ///< A tile in the rainforest (manually set in scenarios, certain distance away from deserts in random games),
 
		TERRAIN_SNOW        ///< A tile on or above the snowline level.
 
	};
 

	
 
	/**
 
	 * Check if this tile is buildable, i.e. no things on it that needs
 
	 *  demolishing.
 
	 * @param tile The tile to check on.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if it is buildable, false if not.
 
	 * @note For trams you also might want to check for ScriptRoad::IsRoad(),
 
	 *   as you can build tram-rails on road-tiles.
 
	 * @note For rail you also might want to check for ScriptRoad::IsRoad(),
 
	 *   as in some cases you can build rails on road-tiles.
 
	 */
 
	static bool IsBuildable(TileIndex tile);
 

	
 
	/**
 
	 * Check if this tile is buildable in a rectangle around a tile, with the
 
	 *  entry in the list as top-left.
 
	 * @param tile The tile to check on.
 
	 * @param width The width of the rectangle.
 
	 * @param height The height of the rectangle.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if it is buildable, false if not.
 
	 */
 
	static bool IsBuildableRectangle(TileIndex tile, uint width, uint height);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a sea tile.
 
	 * @param tile The tile to check on.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile is a sea tile.
 
	 */
 
	static bool IsSeaTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a river tile.
 
	 * @param tile The tile to check on.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile is a river tile.
 
	 */
 
	static bool IsRiverTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a water tile.
 
	 * @param tile The tile to check on.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile is a water tile.
 
	 * @note Returns false when a buoy is on the tile.
 
	 */
 
	static bool IsWaterTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is actually a coast tile.
 
	 * @param tile The tile to check.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile is a coast tile.
 
	 * @note Building on coast tiles in general is more expensive. This is not
 
	 *  true if there are also trees on the tile, see #HasTreeOnTile.
 
	 */
 
	static bool IsCoastTile(TileIndex tile);
 

	
 
	/**
 
	 * Checks whether the given tile is a station tile of any station.
 
	 * @param tile The tile to check.
 
	 * @pre ScriptMap::IsValidTile(tile).
 
	 * @return True if and only if the tile is a station tile.
 
	 */
 
	static bool IsStationTile(TileIndex tile);
 

	
 
	/**
 
	 * Check if a tile has a steep slope.
 
	 * Steep slopes are slopes with a height difference of 2 across one diagonal of the tile.
0 comments (0 inline, 0 general)